(data: Uint8Array)
| 142 | } |
| 143 | |
| 144 | function getPushDataOpcode(data: Uint8Array): Uint8Array { |
| 145 | const { byteLength } = data; |
| 146 | |
| 147 | if (byteLength === 0) return Uint8Array.from([0x4c, 0x00]); |
| 148 | if (byteLength < 76) return Uint8Array.from([byteLength]); |
| 149 | if (byteLength < 256) return Uint8Array.from([0x4c, byteLength]); |
| 150 | throw Error('Pushdata too large'); |
| 151 | } |
| 152 | |
| 153 | export function generateContractBytecodeScript(baseScript: Script, encodedConstructorArgs: Script): Script { |
| 154 | return [...encodedConstructorArgs.slice().reverse(), ...baseScript]; |
no outgoing calls
no test coverage detected