Crates.io | godwoken-polyjuice |
lib.rs | godwoken-polyjuice |
version | 0.6.0 |
source | src |
created_at | 2020-12-03 06:51:18.799785 |
updated_at | 2021-05-06 08:11:57.203413 |
description | Polyjuice scripts for godwoken |
homepage | |
repository | https://github.com/nervosnetwork/godwoken-polyjuice |
max_upload_size | |
id | 319231 |
size | 1,279,119 |
An Ethereum compatible backend for Godwoken rollup framework. It include generator and validator implementations.
ecrecover
sha256hash
ripemd160hash
dataCopy
bigModExp
bn256AddIstanbul
bn256ScalarMulIstanbul
bn256PairingIstanbul (performance issue)
blake2F
header : [u8; 8] (header[0] = 0xff,
header[1] = 0xff,
header[2] = 0xff,
header[3..7] = "POLY"
header[7] = call_kind { 0: CALL, 3: CREATE })
gas_limit : u64 (little endian)
gas_price : u128 (little endian)
value : u128 (little endian)
input_size : u32 (little endian)
input_data : [u8; input_size] (input data)
Every polyjuice argument fields must been serialized one by one and put into godwoken RawL2Transaction.args
for polyjuice to read. If the input_data
have 56 bytes, then the serialized data size is 8 + 8 + 16 + 16 + 4 + 56 = 108
bytes.
code_hash: polyjuice_validator_type_script_hash
hash_type: type
args:
rollup_type_hash : [u8; 32]
sudt_id : u32 (little endian, the token id)
Polyjuice creator account is a godwoken account for creating polyjuice contract account. This account can only been created by meta contract, and the account id is used as the chain id in polyjuice. The sudt_id
field in script args is the sudt token current polyjuice instance bind to.
code_hash: polyjuice_validator_type_script_hash
hash_type: type
args:
rollup_type_hash : [u8; 32]
creator_account_id : u32 (little endian, also chain id, and for reading 'sudt_id' from creator account script)
sender_account_id : u32 (little endian)
sender_nonce : u32 (little endian)
The polyjuice contract account created in polyjuice by CREATE
call kind or op code.
code_hash: polyjuice_validator_type_script_hash
hash_type: type
args:
rollup_type_hash : [u8; 32]
creator_account_id : u32 (little endian, also chain id, and for reading 'sudt_id' from creator account script)
special_byte : u8 (value is '0xff', refer to ethereum)
sender_account_id : u32 (little endian)
create2_salt : [u8; 32] (create2 salt)
init_code_hash : [u8; 32] (keccak256(init_code))
The polyjuice contract account created in polyjuice by CREATE2
op code.