neo-devpack-solidity 0.22.0

Production-focused Solidity-to-NeoVM compilation system
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
fn push_data(bytecode: &mut Vec<u8>, data: &[u8]) {
    if data.len() <= u8::MAX as usize {
        bytecode.push(0x0C);
        bytecode.push(data.len() as u8);
    } else if data.len() <= u16::MAX as usize {
        bytecode.push(0x0D);
        bytecode.extend_from_slice(&(data.len() as u16).to_le_bytes());
    } else {
        bytecode.push(0x0E);
        bytecode.extend_from_slice(&(data.len() as u32).to_le_bytes());
    }
    bytecode.extend_from_slice(data);
}