diff --git a/.gitignore b/.gitignore index 41e977f..b148ce8 100644 --- a/.gitignore +++ b/.gitignore @@ -10,3 +10,5 @@ Cargo.lock **/*.rs.bk history.txt + +/.vscode/ diff --git a/Cargo.toml b/Cargo.toml index da87141..83f9a6d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,15 +6,16 @@ license = "MIT" # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -async-trait = "0.1.57" +async-trait = "0.1" +axon-protocol = { git = "https://github.com/axonweb3/axon", package = "axon-protocol", tag = "v0.1.0-beta.1" } -axon-protocol = { git = "https://github.com/axonweb3/axon", package = "axon-protocol", tag = "v0.1.0-alpha.1" } +axon-tools = "0.1" ckb-crypto = { version = "0.106", features = ["secp"] } ckb-fixed-hash-core = "0.106" ckb-hash = "0.106" ckb-jsonrpc-types = "0.106" -ckb-sdk = "~2.4" +ckb-sdk = "2.5" ckb-types = "0.106" blake2b-rs = "0.2" @@ -23,19 +24,19 @@ ophelia-blst = "0.3" ophelia-secp256k1 = "0.3" rand = "0.7" secp256k1 = { version = "0.24", features = ["recovery"] } -tentacle-secio = "0.5" +tentacle-secio = "0.6" contract-address = "0.6" -ethers-core = "1.0" +ethers-core = "2.0" -clap = { version = "3.1", features = ["cargo", "derive"] } +clap = { version = "4.3", features = ["cargo", "derive"] } colored = "2.0" log = { version = "0.4", features = ["std"] } rustyline = { version = "9.1", features = ["case_insensitive_history_search"] } simplelog = "0.12" molecule = "0.7.2" -serde = "1.0" +serde = { version = "1.0", features = ["derive"] } serde_json = { version = "1.0", features = ["raw_value"] } crossbeam-utils = "0.8" diff --git a/rust-toolchain b/rust-toolchain index 9405730..bfe79d0 100644 --- a/rust-toolchain +++ b/rust-toolchain @@ -1 +1 @@ -1.64.0 +1.70 diff --git a/src/apm.rs b/src/apm.rs index e12b29a..b6f7bf4 100644 --- a/src/apm.rs +++ b/src/apm.rs @@ -92,7 +92,7 @@ pub struct Apm {} #[async_trait] impl SubCommand for Apm { - fn get_command(&self) -> Command<'static> { + fn get_command(&self) -> Command { ApmActions::augment_subcommands(Command::new("apm")) .about("Manage APM (Application Performance Management)") } diff --git a/src/assets/CrossChain.json b/src/assets/CrossChain.json deleted file mode 100644 index 7b6aad4..0000000 --- a/src/assets/CrossChain.json +++ /dev/null @@ -1,660 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "CrossChain", - "sourceName": "contracts/crosschain.sol", - "abi": [ - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "uint256", - "name": "minWCKB", - "type": "uint256" - } - ], - "name": "ChangeMinWCKB", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "feeRatio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "threshold", - "type": "uint256" - } - ], - "indexed": false, - "internalType": "struct DataType.TokenConfig", - "name": "config", - "type": "tuple" - } - ], - "name": "ChangeTokenConfig", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "sUDTAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "CKBAmount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "txHash", - "type": "bytes32" - } - ], - "indexed": false, - "internalType": "struct DataType.CKBToAxonRecord[]", - "name": "records", - "type": "tuple[]" - } - ], - "name": "CrossFromCKB", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "bytes32", - "name": "currentRecordHash", - "type": "bytes32" - }, - { - "indexed": false, - "internalType": "bytes32[]", - "name": "remainRecordsHash", - "type": "bytes32[]" - } - ], - "name": "CrossLimitRecord", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "to", - "type": "string" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "minWCKBAmount", - "type": "uint256" - } - ], - "name": "CrossToCKB", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "string", - "name": "to", - "type": "string" - }, - { - "indexed": false, - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "minWCKBAmount", - "type": "uint256" - } - ], - "name": "CrossToCKBAlert", - "type": "event" - }, - { - "inputs": [], - "name": "AT_ADDRESS", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "typehash", - "type": "bytes32" - } - ], - "name": "addMirrorToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "bytes32", - "name": "typehash", - "type": "bytes32" - } - ], - "name": "addToken", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "addWhitelist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minWCKBAmount", - "type": "uint256" - }, - { - "internalType": "string", - "name": "to", - "type": "string" - }, - { - "internalType": "uint256", - "name": "limitSign", - "type": "uint256" - } - ], - "internalType": "struct DataType.AxonToCKBRecord", - "name": "record", - "type": "tuple" - } - ], - "name": "approveLimitTx", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "metadata", - "type": "address" - }, - { - "internalType": "address", - "name": "wCKB", - "type": "address" - } - ], - "name": "construct", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "components": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "sUDTAmount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "CKBAmount", - "type": "uint256" - }, - { - "internalType": "bytes32", - "name": "txHash", - "type": "bytes32" - } - ], - "internalType": "struct DataType.CKBToAxonRecord[]", - "name": "records", - "type": "tuple[]" - }, - { - "internalType": "uint256", - "name": "nonce", - "type": "uint256" - } - ], - "name": "crossFromCKB", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "to", - "type": "string" - }, - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "crossTokenToCKB", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "fee", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "typehash", - "type": "bytes32" - } - ], - "name": "getTokenAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "getTokenConfig", - "outputs": [ - { - "components": [ - { - "internalType": "uint256", - "name": "feeRatio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "threshold", - "type": "uint256" - } - ], - "internalType": "struct DataType.TokenConfig", - "name": "", - "type": "tuple" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "getTypehash", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getWCKBAddress", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "getWCKBMin", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "isMirrorToken", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "isWhitelist", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "limitTxes", - "outputs": [ - { - "components": [ - { - "internalType": "address", - "name": "tokenAddress", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "minWCKBAmount", - "type": "uint256" - }, - { - "internalType": "string", - "name": "to", - "type": "string" - }, - { - "internalType": "uint256", - "name": "limitSign", - "type": "uint256" - } - ], - "internalType": "struct DataType.AxonToCKBRecord[]", - "name": "", - "type": "tuple[]" - }, - { - "internalType": "bytes32[]", - "name": "", - "type": "bytes32[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "string", - "name": "to", - "type": "string" - } - ], - "name": "lockAT", - "outputs": [], - "stateMutability": "payable", - "type": "function" - }, - { - "inputs": [], - "name": "mirrorTokens", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - } - ], - "name": "removeWhitelist", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "token", - "type": "address" - }, - { - "components": [ - { - "internalType": "uint256", - "name": "feeRatio", - "type": "uint256" - }, - { - "internalType": "uint256", - "name": "threshold", - "type": "uint256" - } - ], - "internalType": "struct DataType.TokenConfig", - "name": "config", - "type": "tuple" - } - ], - "name": "setTokenConfig", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "setWCKBMin", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "whitelist", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - } - ], - "stateMutability": "view", - "type": "function" - } - ], - "bytecode": "0x608060405234801561001057600080fd5b50613c82806100206000396000f3fe6080604052600436106101405760003560e01c80639e6eda18116100b6578063c683630d1161006f578063c683630d14610433578063cb67e3b114610470578063cb6ebb9b146104ad578063db2b749f146104ea578063e6c8283e14610506578063f80f5dd51461054357610140565b80639e6eda1814610312578063a938d7451461034f578063b12e441014610378578063b8f564f8146103b5578063bf56fbd0146103de578063c0c1eebc1461040a57610140565b806365744d241161010857806365744d24146102185780636b23fd201461024157806378196bd61461026a57806378c8cda71461029357806393e59dc1146102bc5780639938155d146102e757610140565b80630b38c8d41461014557806319e4d9891461016e5780632083d267146101995780633edfdbb0146101c4578063540f6dec146101ed575b600080fd5b34801561015157600080fd5b5061016c60048036038101906101679190612a0f565b61056c565b005b34801561017a57600080fd5b50610183610665565b6040516101909190613566565b60405180910390f35b3480156101a557600080fd5b506101ae61066f565b6040516101bb9190613296565b60405180910390f35b3480156101d057600080fd5b506101eb60048036038101906101e69190612a87565b610699565b005b3480156101f957600080fd5b50610202610856565b60405161020f9190613296565b60405180910390f35b34801561022457600080fd5b5061023f600480360381019061023a9190612a4b565b61085b565b005b34801561024d57600080fd5b5061026860048036038101906102639190612aff565b61095c565b005b34801561027657600080fd5b50610291600480360381019061028c9190612c51565b610b85565b005b34801561029f57600080fd5b506102ba60048036038101906102b591906129e6565b610e03565b005b3480156102c857600080fd5b506102d1610f02565b6040516102de919061333a565b60405180910390f35b3480156102f357600080fd5b506102fc610f13565b604051610309919061333a565b60405180910390f35b34801561031e57600080fd5b5061033960048036038101906103349190612ac3565b610f24565b6040516103469190613566565b60405180910390f35b34801561035b57600080fd5b5061037660048036038101906103719190612cbb565b610f95565b005b34801561038457600080fd5b5061039f600480360381019061039a9190612b80565b6110cb565b6040516103ac9190613296565b60405180910390f35b3480156103c157600080fd5b506103dc60048036038101906103d79190612bea565b611108565b005b3480156103ea57600080fd5b506103f36115d8565b60405161040192919061335c565b60405180910390f35b34801561041657600080fd5b50610431600480360381019061042c9190612a4b565b611844565b005b34801561043f57600080fd5b5061045a600480360381019061045591906129e6565b611945565b60405161046791906133b7565b60405180910390f35b34801561047c57600080fd5b50610497600480360381019061049291906129e6565b611962565b6040516104a4919061354b565b60405180910390f35b3480156104b957600080fd5b506104d460048036038101906104cf91906129e6565b6119cf565b6040516104e191906133b7565b60405180910390f35b61050460048036038101906104ff9190612ba9565b6119ec565b005b34801561051257600080fd5b5061052d600480360381019061052891906129e6565b611c44565b60405161053a91906133d2565b60405180910390f35b34801561054f57600080fd5b5061056a600480360381019061056591906129e6565b611c8d565b005b67ffffffffffffffff60008190555081600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555061062c600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166000801b611d8c565b610657600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611dce565b6106616008611e05565b5050565b6000600454905090565b6000600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663331052186106df611e1b565b6040518263ffffffff1660e01b81526004016106fb9190613296565b602060405180830381600087803b15801561071557600080fd5b505af1158015610729573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061074d9190612b57565b61078c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610783906134c9565b60405180910390fd5b80600f60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081816107d89190613bbf565b9050507ffeaed4526f1ec7bb9e164d6ecd02e154e4312afd2ea0a0c7fb265ecc51517f5182600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060405161084a9291906132e8565b60405180910390a15050565b600081565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663331052186108a1611e1b565b6040518263ffffffff1660e01b81526004016108bd9190613296565b602060405180830381600087803b1580156108d757600080fd5b505af11580156108eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061090f9190612b57565b61094e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610945906134c9565b60405180910390fd5b6109588282611d8c565b5050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663331052186109a2611e1b565b6040518263ffffffff1660e01b81526004016109be9190613296565b602060405180830381600087803b1580156109d857600080fd5b505af11580156109ec573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a109190612b57565b610a4f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a46906134c9565b60405180910390fd5b600083839050905060005b81811015610b45576000858583818110610a9d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060a00201803603810190610ab39190612c92565b905060008160400151148015610acd575060008160600151145b15610ad85750610b34565b610ae181611e23565b600073ffffffffffffffffffffffffffffffffffffffff16816020015173ffffffffffffffffffffffffffffffffffffffff161415610b2857610b2381611ed0565b610b32565b610b3181611f35565b5b505b80610b3e906138ce565b9050610a5a565b507f3e364b471f5bb448a1efc0c6198566fd886f0d3f866c6896c0d0cffebd452e428484604051610b77929190613393565b60405180910390a150505050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166333105218610bcb611e1b565b6040518263ffffffff1660e01b8152600401610be79190613296565b602060405180830381600087803b158015610c0157600080fd5b505af1158015610c15573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c399190612b57565b610c78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6f906134c9565b60405180910390fd5b600081604051602001610c8b9190613529565b604051602081830303815290604052805190602001209050610cb781600661207690919063ffffffff16565b610cf6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ced90613469565b60405180910390fd5b7fb3f8ed69a3b49c0460199974be11a2a9852ad17addee34ac9c7274e1164022e08260600151836000015184602001518560400151604051610d3b949392919061341d565b60405180910390a1610d5781600661208d90919063ffffffff16565b50600d6000828152602001908152602001600020600080820160006101000a81549073ffffffffffffffffffffffffffffffffffffffff021916905560018201600090556002820160009055600382016000610db39190612646565b600482016000905550507f847cab1d28004b25c9b061d33e783b3ae78a1f021d5b56f538e603afdda3e3e581610de960066120a4565b604051610df79291906133ed565b60405180910390a15050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166333105218610e49611e1b565b6040518263ffffffff1660e01b8152600401610e659190613296565b602060405180830381600087803b158015610e7f57600080fd5b505af1158015610e93573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610eb79190612b57565b610ef6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610eed906134c9565b60405180910390fd5b610eff816120b9565b50565b6060610f0e60096120d1565b905090565b6060610f1f600b6120d1565b905090565b600080600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050806000015191505092915050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166333105218610fdb611e1b565b6040518263ffffffff1660e01b8152600401610ff79190613296565b602060405180830381600087803b15801561101157600080fd5b505af1158015611025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110499190612b57565b611088576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161107f906134c9565b60405180910390fd5b806004819055507ff112e5e682173f195e35996c938ef643bba5b7b6a5692f08fe34dd9ff06a1dd56004546040516110c09190613566565b60405180910390a150565b60006011600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050919050565b8161111281611945565b611151576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161114890613509565b60405180910390fd5b60008211611194576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161118b90613489565b60405180910390fd5b600454600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a082316111dd611e1b565b6040518263ffffffff1660e01b81526004016111f99190613296565b60206040518083038186803b15801561121157600080fd5b505afa158015611225573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112499190612ce4565b11611289576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611280906134e9565b60405180910390fd5b611292836119cf565b1561137757600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156112fe57600454826112fb9190613727565b91505b8273ffffffffffffffffffffffffffffffffffffffff16639dc29fac611322611e1b565b846040518363ffffffff1660e01b8152600401611340929190613311565b600060405180830381600087803b15801561135a57600080fd5b505af115801561136e573d6000803e3d6000fd5b5050505061140f565b8273ffffffffffffffffffffffffffffffffffffffff166323b872dd61139b611e1b565b30856040518463ffffffff1660e01b81526004016113bb939291906132b1565b602060405180830381600087803b1580156113d557600080fd5b505af11580156113e9573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061140d9190612b57565b505b600060045411156114d657600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd611460611e1b565b306004546040518463ffffffff1660e01b8152600401611482939291906132b1565b602060405180830381600087803b15801561149c57600080fd5b505af11580156114b0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114d49190612b57565b505b6114e083836120f2565b15611592576114ed612686565b84816060018190525083816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508281602001818152505060045481604001818152505061154d81612142565b7f94625b0a2dd0ef3e6dabbf52be47159b47cbd3ac7efb51b7a8d363a540c00bbe858585600454604051611584949392919061341d565b60405180910390a1506115d2565b7fb3f8ed69a3b49c0460199974be11a2a9852ad17addee34ac9c7274e1164022e08484846004546040516115c9949392919061341d565b60405180910390a15b50505050565b60608060006115e7600661225c565b67ffffffffffffffff811115611626577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405190808252806020026020018201604052801561165f57816020015b61164c612686565b8152602001906001900390816116445790505b509050600061166e60066120a4565b905060005b815181101561183757600d60008383815181106116b9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001015181526020019081526020016000206040518060a00160405290816000820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001600182015481526020016002820154815260200160038201805461175490613851565b80601f016020809104026020016040519081016040528092919081815260200182805461178090613851565b80156117cd5780601f106117a2576101008083540402835291602001916117cd565b820191906000526020600020905b8154815290600101906020018083116117b057829003601f168201915b50505050508152602001600482015481525050838281518110611819577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6020026020010181905250808061182f906138ce565b915050611673565b5081819350935050509091565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16633310521861188a611e1b565b6040518263ffffffff1660e01b81526004016118a69190613296565b602060405180830381600087803b1580156118c057600080fd5b505af11580156118d4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118f89190612b57565b611937576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161192e906134c9565b60405180910390fd5b6119418282612271565b5050565b600061195b82600961230b90919063ffffffff16565b9050919050565b61196a6126cb565b600f60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604051806040016040529081600082015481526020016001820154815250509050919050565b60006119e582600b61230b90919063ffffffff16565b9050919050565b60006119f781611945565b611a36576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a2d90613509565b60405180910390fd5b60003411611a79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a70906134a9565b60405180910390fd5b60006004541115611b4057600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166323b872dd611aca611e1b565b306004546040518463ffffffff1660e01b8152600401611aec939291906132b1565b602060405180830381600087803b158015611b0657600080fd5b505af1158015611b1a573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b3e9190612b57565b505b611b4b6000346120f2565b15611bff57611b58612686565b8281606001819052506000816000019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505034816020018181525050600454816040018181525050611bb981612142565b7f94625b0a2dd0ef3e6dabbf52be47159b47cbd3ac7efb51b7a8d363a540c00bbe83600034600454604051611bf1949392919061341d565b60405180910390a150611c40565b7fb3f8ed69a3b49c0460199974be11a2a9852ad17addee34ac9c7274e1164022e082600034600454604051611c37949392919061341d565b60405180910390a15b5050565b6000601060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166333105218611cd3611e1b565b6040518263ffffffff1660e01b8152600401611cef9190613296565b602060405180830381600087803b158015611d0957600080fd5b505af1158015611d1d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d419190612b57565b611d80576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d77906134c9565b60405180910390fd5b611d8981611dce565b50565b611da082600b61230b90919063ffffffff16565b15611daa57611dca565b611dbe82600b61233b90919063ffffffff16565b50611dc98282612271565b5b5050565b611de281600961230b90919063ffffffff16565b15611dec57611e02565b611e0081600961233b90919063ffffffff16565b505b50565b6001816000016000828254019250508190555050565b600033905090565b600081606001511415611e3557611ecd565b600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166340c10f19826000015183606001516040518363ffffffff1660e01b8152600401611e9a929190613311565b600060405180830381600087803b158015611eb457600080fd5b505af1158015611ec8573d6000803e3d6000fd5b505050505b50565b600081604001511415611ee257611f32565b806000015173ffffffffffffffffffffffffffffffffffffffff166108fc82604001519081150290604051600060405180830381858888f19350505050158015611f30573d6000803e3d6000fd5b505b50565b600081604001511415611f4757612073565b611f5481602001516119cf565b15611fd757806020015173ffffffffffffffffffffffffffffffffffffffff166340c10f19826000015183604001516040518363ffffffff1660e01b8152600401611fa0929190613311565b600060405180830381600087803b158015611fba57600080fd5b505af1158015611fce573d6000803e3d6000fd5b50505050612072565b806020015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb826000015183604001516040518363ffffffff1660e01b815260040161201e929190613311565b602060405180830381600087803b15801561203857600080fd5b505af115801561204c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120709190612b57565b505b5b50565b6000612085836000018361236b565b905092915050565b600061209c836000018361238e565b905092915050565b60606120b282600001612514565b9050919050565b6120cd81600961257090919063ffffffff16565b5050565b606060006120e183600001612514565b905060608190508092505050919050565b600081600f60008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600101541115905092915050565b61214c60086125a0565b81608001818152505061215f6008611e05565b6000816040516020016121729190613529565b60405160208183030381529060405280519060200120905061219e81600661207690919063ffffffff16565b156121a95750612259565b6121bd8160066125ae90919063ffffffff16565b5081600d600083815260200190815260200160002060008201518160000160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550602082015181600101556040820151816002015560608201518160030190805190602001906122499291906126e5565b5060808201518160040155905050505b50565b600061226a826000016125c5565b9050919050565b816011600083815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080601060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505050565b6000612333836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61236b565b905092915050565b6000612363836000018373ffffffffffffffffffffffffffffffffffffffff1660001b6125d6565b905092915050565b600080836001016000848152602001908152602001600020541415905092915050565b600080836001016000848152602001908152602001600020549050600081146125085760006001826123c09190613727565b90506000600186600001805490506123d89190613727565b905081811461249357600086600001828154811061241f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9060005260206000200154905080876000018481548110612469577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002001819055508387600101600083815260200190815260200160002081905550505b856000018054806124cd577f4e487b7100000000000000000000000000000000000000000000000000000000600052603160045260246000fd5b60019003818190600052602060002001600090559055856001016000868152602001908152602001600020600090556001935050505061250e565b60009150505b92915050565b60608160000180548060200260200160405190810160405280929190818152602001828054801561256457602002820191906000526020600020905b815481526020019060010190808311612550575b50505050509050919050565b6000612598836000018373ffffffffffffffffffffffffffffffffffffffff1660001b61238e565b905092915050565b600081600001549050919050565b60006125bd83600001836125d6565b905092915050565b600081600001805490509050919050565b60006125e2838361236b565b61263b578260000182908060018154018082558091505060019003906000526020600020016000909190919091505582600001805490508360010160008481526020019081526020016000208190555060019050612640565b600090505b92915050565b50805461265290613851565b6000825580601f106126645750612683565b601f016020900490600052602060002090810190612682919061276b565b5b50565b6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160608152602001600081525090565b604051806040016040528060008152602001600081525090565b8280546126f190613851565b90600052602060002090601f016020900481019282612713576000855561275a565b82601f1061272c57805160ff191683800117855561275a565b8280016001018555821561275a579182015b8281111561275957825182559160200191906001019061273e565b5b509050612767919061276b565b5090565b5b8082111561278457600081600090555060010161276c565b5090565b600061279b612796846135a6565b613581565b9050828152602081018484840111156127b357600080fd5b6127be8482856137c9565b509392505050565b6000813590506127d581613bf0565b92915050565b60008083601f8401126127ed57600080fd5b8235905067ffffffffffffffff81111561280657600080fd5b6020830191508360a082028301111561281e57600080fd5b9250929050565b60008151905061283481613c07565b92915050565b60008135905061284981613c1e565b92915050565b600082601f83011261286057600080fd5b8135612870848260208601612788565b91505092915050565b600060a0828403121561288b57600080fd5b61289560a0613581565b905060006128a5848285016127c6565b60008301525060206128b9848285016129bc565b60208301525060406128cd848285016129bc565b604083015250606082013567ffffffffffffffff8111156128ed57600080fd5b6128f98482850161284f565b606083015250608061290d848285016129bc565b60808301525092915050565b600060a0828403121561292b57600080fd5b61293560a0613581565b90506000612945848285016127c6565b6000830152506020612959848285016127c6565b602083015250604061296d848285016129bc565b6040830152506060612981848285016129bc565b60608301525060806129958482850161283a565b60808301525092915050565b6000604082840312156129b357600080fd5b81905092915050565b6000813590506129cb81613c35565b92915050565b6000815190506129e081613c35565b92915050565b6000602082840312156129f857600080fd5b6000612a06848285016127c6565b91505092915050565b60008060408385031215612a2257600080fd5b6000612a30858286016127c6565b9250506020612a41858286016127c6565b9150509250929050565b60008060408385031215612a5e57600080fd5b6000612a6c858286016127c6565b9250506020612a7d8582860161283a565b9150509250929050565b60008060608385031215612a9a57600080fd5b6000612aa8858286016127c6565b9250506020612ab9858286016129a1565b9150509250929050565b60008060408385031215612ad657600080fd5b6000612ae4858286016127c6565b9250506020612af5858286016129bc565b9150509250929050565b600080600060408486031215612b1457600080fd5b600084013567ffffffffffffffff811115612b2e57600080fd5b612b3a868287016127db565b93509350506020612b4d868287016129bc565b9150509250925092565b600060208284031215612b6957600080fd5b6000612b7784828501612825565b91505092915050565b600060208284031215612b9257600080fd5b6000612ba08482850161283a565b91505092915050565b600060208284031215612bbb57600080fd5b600082013567ffffffffffffffff811115612bd557600080fd5b612be18482850161284f565b91505092915050565b600080600060608486031215612bff57600080fd5b600084013567ffffffffffffffff811115612c1957600080fd5b612c258682870161284f565b9350506020612c36868287016127c6565b9250506040612c47868287016129bc565b9150509250925092565b600060208284031215612c6357600080fd5b600082013567ffffffffffffffff811115612c7d57600080fd5b612c8984828501612879565b91505092915050565b600060a08284031215612ca457600080fd5b6000612cb284828501612919565b91505092915050565b600060208284031215612ccd57600080fd5b6000612cdb848285016129bc565b91505092915050565b600060208284031215612cf657600080fd5b6000612d04848285016129d1565b91505092915050565b6000612d198383612d69565b60208301905092915050565b6000612d318383612f24565b60208301905092915050565b6000612d498383613086565b905092915050565b6000612d5d8383613172565b60a08301905092915050565b612d7281613765565b82525050565b612d8181613765565b82525050565b6000612d9282613611565b612d9c8185613671565b9350612da7836135d7565b8060005b83811015612dd8578151612dbf8882612d0d565b9750612dca8361363d565b925050600181019050612dab565b5085935050505092915050565b6000612df08261361c565b612dfa8185613682565b9350612e05836135e7565b8060005b83811015612e36578151612e1d8882612d25565b9750612e288361364a565b925050600181019050612e09565b5085935050505092915050565b6000612e4e82613627565b612e588185613693565b935083602082028501612e6a856135f7565b8060005b85811015612ea65784840389528151612e878582612d3d565b9450612e9283613657565b925060208a01995050600181019050612e6e565b50829750879550505050505092915050565b6000612ec483856136a4565b9350612ecf82613607565b8060005b85811015612f0857612ee58284613705565b612eef8882612d51565b9750612efa83613664565b925050600181019050612ed3565b5085925050509392505050565b612f1e81613777565b82525050565b612f2d81613783565b82525050565b612f3c81613783565b82525050565b6000612f4d82613632565b612f5781856136b5565b9350612f678185602086016137d8565b612f70816139c4565b840191505092915050565b6000612f8682613632565b612f9081856136c6565b9350612fa08185602086016137d8565b612fa9816139c4565b840191505092915050565b6000612fc1601f836136c6565b9150612fcc826139ef565b602082019050919050565b6000612fe46026836136c6565b9150612fef82613a18565b604082019050919050565b60006130076025836136c6565b915061301282613a67565b604082019050919050565b600061302a6023836136c6565b915061303582613ab6565b604082019050919050565b600061304d602a836136c6565b915061305882613b05565b604082019050919050565b6000613070601f836136c6565b915061307b82613b54565b602082019050919050565b600060a08301600083015161309e6000860182612d69565b5060208301516130b16020860182613278565b5060408301516130c46040860182613278565b50606083015184820360608601526130dc8282612f42565b91505060808301516130f16080860182613278565b508091505092915050565b600060a0830160008301516131146000860182612d69565b5060208301516131276020860182613278565b50604083015161313a6040860182613278565b50606083015184820360608601526131528282612f42565b91505060808301516131676080860182613278565b508091505092915050565b60a0820161318360008301836136d7565b6131906000850182612d69565b5061319e60208301836136d7565b6131ab6020850182612d69565b506131b96040830183613710565b6131c66040850182613278565b506131d46060830183613710565b6131e16060850182613278565b506131ef60808301836136ee565b6131fc6080850182612f24565b50505050565b6040820160008201516132186000850182613278565b50602082015161322b6020850182613278565b50505050565b60408201600080830154905061324681613883565b6132536000860182613278565b506001830154905061326481613883565b6132716020860182613278565b5050505050565b613281816137ad565b82525050565b613290816137ad565b82525050565b60006020820190506132ab6000830184612d78565b92915050565b60006060820190506132c66000830186612d78565b6132d36020830185612d78565b6132e06040830184613287565b949350505050565b60006060820190506132fd6000830185612d78565b61330a6020830184613231565b9392505050565b60006040820190506133266000830185612d78565b6133336020830184613287565b9392505050565b600060208201905081810360008301526133548184612d87565b905092915050565b600060408201905081810360008301526133768185612e43565b9050818103602083015261338a8184612de5565b90509392505050565b600060208201905081810360008301526133ae818486612eb8565b90509392505050565b60006020820190506133cc6000830184612f15565b92915050565b60006020820190506133e76000830184612f33565b92915050565b60006040820190506134026000830185612f33565b81810360208301526134148184612de5565b90509392505050565b600060808201905081810360008301526134378187612f7b565b90506134466020830186612d78565b6134536040830185613287565b6134606060830184613287565b95945050505050565b6000602082019050818103600083015261348281612fb4565b9050919050565b600060208201905081810360008301526134a281612fd7565b9050919050565b600060208201905081810360008301526134c281612ffa565b9050919050565b600060208201905081810360008301526134e28161301d565b9050919050565b6000602082019050818103600083015261350281613040565b9050919050565b6000602082019050818103600083015261352281613063565b9050919050565b6000602082019050818103600083015261354381846130fc565b905092915050565b60006040820190506135606000830184613202565b92915050565b600060208201905061357b6000830184613287565b92915050565b600061358b61359c565b9050613597828261389d565b919050565b6000604051905090565b600067ffffffffffffffff8211156135c1576135c0613975565b5b6135ca826139c4565b9050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b6000819050919050565b600081519050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b6000602082019050919050565b600060a082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b60006136e660208401846127c6565b905092915050565b60006136fd602084018461283a565b905092915050565b600082905092915050565b600061371f60208401846129bc565b905092915050565b6000613732826137ad565b915061373d836137ad565b9250828210156137505761374f613917565b5b828203905092915050565b6000819050919050565b60006137708261378d565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b60006137c2826137ad565b9050919050565b82818337600083830152505050565b60005b838110156137f65780820151818401526020810190506137db565b83811115613805576000848401525b50505050565b60008101600083018061381d816139ae565b90506138298184613bcd565b50505060018101602083018061383e816139ae565b905061384a8184613bcd565b5050505050565b6000600282049050600182168061386957607f821691505b6020821081141561387d5761387c613946565b5b50919050565b6000613896613891836139e2565b61375b565b9050919050565b6138a6826139c4565b810181811067ffffffffffffffff821117156138c5576138c4613975565b5b80604052505050565b60006138d9826137ad565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82141561390c5761390b613917565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000819050919050565b600081356139bb81613c35565b80915050919050565b6000601f19601f8301169050919050565b60008160001b9050919050565b60008160001c9050919050565b7f43726f7373436861696e3a206c696d6974207478206e6f742065786973747300600082015250565b7f43726f7373436861696e3a20616d6f756e74206d757374206265206d6f72652060008201527f7468616e20300000000000000000000000000000000000000000000000000000602082015250565b7f43726f7373436861696e3a2076616c7565206d757374206265206d6f7265207460008201527f68616e2030000000000000000000000000000000000000000000000000000000602082015250565b7f43726f7373436861696e3a2073656e646572206d75737420626520766572696660008201527f6965720000000000000000000000000000000000000000000000000000000000602082015250565b7f43726f7373436861696e3a20616d6f756e74206f662077636b6220697320696e60008201527f73756666696369656e7400000000000000000000000000000000000000000000602082015250565b7f43726f7373436861696e3a20746f6b656e206e6f742077686974656c69737400600082015250565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff613ba9846139d5565b9350801983169250808416831791505092915050565b613bc9828261380b565b5050565b613bd6826137b7565b613be9613be2826139a4565b8354613b7d565b8255505050565b613bf981613765565b8114613c0457600080fd5b50565b613c1081613777565b8114613c1b57600080fd5b50565b613c2781613783565b8114613c3257600080fd5b50565b613c3e816137ad565b8114613c4957600080fd5b5056fea2646970667358221220a908f513393dd80ebbbe0c7f68099c945bbc61172c32d3be53d8ad32910042f664736f6c63430008040033", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/src/assets/ERC1967Proxy.json b/src/assets/ERC1967Proxy.json deleted file mode 100644 index baf0cd7..0000000 --- a/src/assets/ERC1967Proxy.json +++ /dev/null @@ -1,79 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "ERC1967Proxy", - "sourceName": "contracts/proxy/ERC1967/ERC1967Proxy.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "address", - "name": "_logic", - "type": "address" - }, - { - "internalType": "bytes", - "name": "_data", - "type": "bytes" - } - ], - "stateMutability": "payable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": false, - "internalType": "address", - "name": "previousAdmin", - "type": "address" - }, - { - "indexed": false, - "internalType": "address", - "name": "newAdmin", - "type": "address" - } - ], - "name": "AdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "beacon", - "type": "address" - } - ], - "name": "BeaconUpgraded", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "implementation", - "type": "address" - } - ], - "name": "Upgraded", - "type": "event" - }, - { - "stateMutability": "payable", - "type": "fallback" - }, - { - "stateMutability": "payable", - "type": "receive" - } - ], - "bytecode": "0x608060405260405161073b38038061073b83398101604081905261002291610321565b61002e82826000610035565b505061043e565b61003e8361006b565b60008251118061004b5750805b156100665761006483836100ab60201b6100291760201c565b505b505050565b610074816100d7565b6040516001600160a01b038216907fbc7cd75a20ee27fd9adebab32041f755214dbc6bffa90cc0225b39da2e5c2d3b90600090a250565b60606100d08383604051806060016040528060278152602001610714602791396101a9565b9392505050565b6100ea8161022260201b6100551760201c565b6101515760405162461bcd60e51b815260206004820152602d60248201527f455243313936373a206e657720696d706c656d656e746174696f6e206973206e60448201526c1bdd08184818dbdb9d1c9858dd609a1b60648201526084015b60405180910390fd5b806101887f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc60001b61023160201b6100641760201c565b80546001600160a01b0319166001600160a01b039290921691909117905550565b6060600080856001600160a01b0316856040516101c691906103ef565b600060405180830381855af49150503d8060008114610201576040519150601f19603f3d011682016040523d82523d6000602084013e610206565b606091505b50909250905061021886838387610234565b9695505050505050565b6001600160a01b03163b151590565b90565b606083156102a357825160000361029c576001600160a01b0385163b61029c5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610148565b50816102ad565b6102ad83836102b5565b949350505050565b8151156102c55781518083602001fd5b8060405162461bcd60e51b8152600401610148919061040b565b634e487b7160e01b600052604160045260246000fd5b60005b838110156103105781810151838201526020016102f8565b838111156100645750506000910152565b6000806040838503121561033457600080fd5b82516001600160a01b038116811461034b57600080fd5b60208401519092506001600160401b038082111561036857600080fd5b818501915085601f83011261037c57600080fd5b81518181111561038e5761038e6102df565b604051601f8201601f19908116603f011681019083821181831017156103b6576103b66102df565b816040528281528860208487010111156103cf57600080fd5b6103e08360208301602088016102f5565b80955050505050509250929050565b600082516104018184602087016102f5565b9190910192915050565b602081526000825180602084015261042a8160408501602087016102f5565b601f01601f19169190910160400192915050565b6102c78061044d6000396000f3fe60806040523661001357610011610017565b005b6100115b610027610022610067565b61009f565b565b606061004e838360405180606001604052806027815260200161026b602791396100c3565b9392505050565b6001600160a01b03163b151590565b90565b600061009a7f360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc546001600160a01b031690565b905090565b3660008037600080366000845af43d6000803e8080156100be573d6000f35b3d6000fd5b6060600080856001600160a01b0316856040516100e0919061021b565b600060405180830381855af49150503d806000811461011b576040519150601f19603f3d011682016040523d82523d6000602084013e610120565b606091505b50915091506101318683838761013b565b9695505050505050565b606083156101af5782516000036101a8576001600160a01b0385163b6101a85760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000060448201526064015b60405180910390fd5b50816101b9565b6101b983836101c1565b949350505050565b8151156101d15781518083602001fd5b8060405162461bcd60e51b815260040161019f9190610237565b60005b838110156102065781810151838201526020016101ee565b83811115610215576000848401525b50505050565b6000825161022d8184602087016101eb565b9190910192915050565b60208152600082518060208401526102568160408501602087016101eb565b601f01601f1916919091016040019291505056fe416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564a26469706673582212208cbc7d5c9e5a07309f651932e58c8e26d865321543ccc32ca0879428474c418f64736f6c634300080d0033416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c6564", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/src/assets/MetadataManager.json b/src/assets/MetadataManager.json index d0d6712..2672d51 100644 --- a/src/assets/MetadataManager.json +++ b/src/assets/MetadataManager.json @@ -107,9 +107,21 @@ "type": "uint64" }, { - "internalType": "bytes32", - "name": "last_checkpoint_block_hash", - "type": "bytes32" + "components": [ + { + "internalType": "address", + "name": "address_", + "type": "address" + }, + { + "internalType": "uint64", + "name": "count", + "type": "uint64" + } + ], + "internalType": "struct MetadataManager.ProposeCount", + "name": "propose_counter", + "type": "tuple[]" } ], "internalType": "struct MetadataManager.Metadata", @@ -122,13 +134,6 @@ "stateMutability": "nonpayable", "type": "function" }, - { - "inputs": [], - "name": "construct", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, { "inputs": [ { @@ -241,9 +246,21 @@ "type": "uint64" }, { - "internalType": "bytes32", - "name": "last_checkpoint_block_hash", - "type": "bytes32" + "components": [ + { + "internalType": "address", + "name": "address_", + "type": "address" + }, + { + "internalType": "uint64", + "name": "count", + "type": "uint64" + } + ], + "internalType": "struct MetadataManager.ProposeCount", + "name": "propose_counter", + "type": "tuple[]" } ], "internalType": "struct MetadataManager.Metadata", @@ -257,61 +274,50 @@ { "inputs": [ { - "internalType": "address", - "name": "verifier", - "type": "address" - } - ], - "name": "isProposer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "relayer", - "type": "address" - } - ], - "name": "isVerifier", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "verifierList", - "outputs": [ - { - "internalType": "address[]", - "name": "", - "type": "address[]" - }, - { - "internalType": "uint256", - "name": "", - "type": "uint256" + "components": [ + { + "internalType": "bytes32", + "name": "metadata_type_id", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "checkpoint_type_id", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "xudt_args", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "stake_smt_type_id", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "delegate_smt_type_id", + "type": "bytes32" + }, + { + "internalType": "bytes32", + "name": "reward_smt_type_id", + "type": "bytes32" + } + ], + "internalType": "struct MetadataManager.CkbRelatedInfo", + "name": "ckb_related_info", + "type": "tuple" } ], + "name": "setCkbRelatedInfo", + "outputs": [], "stateMutability": "view", "type": "function" } ], - "bytecode": "0x608060405234801561001057600080fd5b506124d3806100206000396000f3fe608060405234801561001057600080fd5b50600436106100625760003560e01c806333105218146100675780634290d10c1461009757806374ec29a0146100b3578063870aac5c146100e357806394b91deb14610102578063998e84a31461010c575b600080fd5b610081600480360381019061007c9190611a46565b61013c565b60405161008e9190611f10565b60405180910390f35b6100b160048036038101906100ac9190611a6f565b610293565b005b6100cd60048036038101906100c89190611a46565b610953565b6040516100da9190611f10565b60405180910390f35b6100eb610d06565b6040516100f9929190611ee0565b60405180910390f35b61010a610f2b565b005b61012660048036038101906101219190611ab0565b610f5e565b6040516101339190611fcb565b60405180910390f35b600080600080600160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060020180549050905060005b81811015610287578373ffffffffffffffffffffffffffffffffffffffff16600080600160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff168152602001908152602001600020600201828154811061021d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020906003020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614156102765760019250505061028e565b8061028090612267565b9050610187565b5060009150505b919050565b6000816020015167ffffffffffffffff1610156102e5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016102dc90611f2b565b60405180910390fd5b6000805b8260a001515181101561038e573373ffffffffffffffffffffffffffffffffffffffff168360a00151828151811061034a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101516040015173ffffffffffffffffffffffffffffffffffffffff16141561037b576001915061038e565b808061038690612267565b9150506102e9565b50806103cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c690611fab565b60405180910390fd5b60008260200151905067ffffffffffffffff8016600160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1614610541578067ffffffffffffffff1660018060009054906101000a900467ffffffffffffffff16610436919061210e565b67ffffffffffffffff1614610480576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161047790611f4b565b60405180910390fd5b6001600080600160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060000160000160089054906101000a900467ffffffffffffffff166104e3919061210e565b67ffffffffffffffff1683600001516000015167ffffffffffffffff1614610540576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161053790611f6b565b60405180910390fd5b5b60008060008367ffffffffffffffff1667ffffffffffffffff168152602001908152602001600020905083600001518160000160008201518160000160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555060208201518160000160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555090505083602001518160010160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555083604001518160010160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555083606001518160010160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555083608001518160010160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508360c001518160030160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508360e001518160030160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508361010001518160030160106101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508361012001518160030160186101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508361014001518160040160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff1602179055508361016001518160040160086101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550836101800151816005018190555060005b8460a001515181101561092357816002018560a00151828151811061080e577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200260200101519080600181540180825580915050600190039060005260206000209060030201600090919091909150600082015181600001908051906020019061085b929190611492565b506020820151816001019080519060200190610878929190611492565b5060408201518160020160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060608201518160020160146101000a81548163ffffffff021916908363ffffffff16021790555060808201518160020160186101000a81548163ffffffff021916908363ffffffff1602179055505050808061091b90612267565b9150506107c0565b5081600160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff16021790555050505050565b600061095d611518565b6000806000600160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060020180549050905060005b81811015610cc957826060015163ffffffff16600080600160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020019081526020016000206002018281548110610a31577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020906003020160020160149054906101000a900463ffffffff1663ffffffff161115610cb857600080600160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020019081526020016000206002018181548110610ad6577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90600052602060002090600302016040518060a0016040529081600082018054610aff90612204565b80601f0160208091040260200160405190810160405280929190818152602001828054610b2b90612204565b8015610b785780601f10610b4d57610100808354040283529160200191610b78565b820191906000526020600020905b815481529060010190602001808311610b5b57829003601f168201915b50505050508152602001600182018054610b9190612204565b80601f0160208091040260200160405190810160405280929190818152602001828054610bbd90612204565b8015610c0a5780601f10610bdf57610100808354040283529160200191610c0a565b820191906000526020600020905b815481529060010190602001808311610bed57829003601f168201915b505050505081526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160149054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016002820160189054906101000a900463ffffffff1663ffffffff1663ffffffff168152505092505b80610cc290612267565b90506109a7565b50816040015173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff161492505050919050565b6060600080600080600160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060020180549050905060008167ffffffffffffffff811115610d92577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051908082528060200260200182016040528015610dc05781602001602082028036833780820191505090505b50905060005b82811015610efb57600080600160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020019081526020016000206002018181548110610e45577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b906000526020600020906003020160020160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16828281518110610eb0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff168152505080610ef490612267565b9050610dc6565b5080600160009054906101000a900467ffffffffffffffff168067ffffffffffffffff1690509350935050509091565b67ffffffffffffffff600160006101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550565b610f66611569565b60008060008467ffffffffffffffff1667ffffffffffffffff168152602001908152602001600020604051806101a0016040529081600082016040518060400160405290816000820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016000820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff168152505081526020016001820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016001820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016001820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016001820160189054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160028201805480602002602001604051908101604052809291908181526020016000905b828210156112f757838290600052602060002090600302016040518060a001604052908160008201805461113290612204565b80601f016020809104026020016040519081016040528092919081815260200182805461115e90612204565b80156111ab5780601f10611180576101008083540402835291602001916111ab565b820191906000526020600020905b81548152906001019060200180831161118e57829003601f168201915b505050505081526020016001820180546111c490612204565b80601f01602080910402602001604051908101604052809291908181526020018280546111f090612204565b801561123d5780601f106112125761010080835404028352916020019161123d565b820191906000526020600020905b81548152906001019060200180831161122057829003601f168201915b505050505081526020016002820160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020016002820160149054906101000a900463ffffffff1663ffffffff1663ffffffff1681526020016002820160189054906101000a900463ffffffff1663ffffffff1663ffffffff1681525050815260200190600101906110ff565b5050505081526020016003820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016003820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016003820160109054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016003820160189054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016004820160009054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff1681526020016004820160089054906101000a900467ffffffffffffffff1667ffffffffffffffff1667ffffffffffffffff16815260200160058201548152505090506000816040015167ffffffffffffffff161415611489576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148090611f8b565b60405180910390fd5b80915050919050565b82805461149e90612204565b90600052602060002090601f0160209004810192826114c05760008555611507565b82601f106114d957805160ff1916838001178555611507565b82800160010185558215611507579182015b828111156115065782518255916020019190600101906114eb565b5b509050611514919061163e565b5090565b6040518060a001604052806060815260200160608152602001600073ffffffffffffffffffffffffffffffffffffffff168152602001600063ffffffff168152602001600063ffffffff1681525090565b604051806101a0016040528061157d61165b565b8152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff16815260200160608152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600067ffffffffffffffff168152602001600080191681525090565b5b8082111561165757600081600090555060010161163f565b5090565b6040518060400160405280600067ffffffffffffffff168152602001600067ffffffffffffffff1681525090565b600061169c61169784612012565b611fed565b905080838252602082019050828560208602820111156116bb57600080fd5b60005b8581101561170557813567ffffffffffffffff8111156116dd57600080fd5b8086016116ea8982611964565b855260208501945060208401935050506001810190506116be565b5050509392505050565b600061172261171d8461203e565b611fed565b90508281526020810184848401111561173a57600080fd5b6117458482856121c2565b509392505050565b60008135905061175c81612441565b92915050565b600082601f83011261177357600080fd5b8135611783848260208601611689565b91505092915050565b60008135905061179b81612458565b92915050565b600082601f8301126117b257600080fd5b81356117c284826020860161170f565b91505092915050565b6000604082840312156117dd57600080fd5b6117e76040611fed565b905060006117f784828501611a31565b600083015250602061180b84828501611a31565b60208301525092915050565b60006101c0828403121561182a57600080fd5b6118356101a0611fed565b90506000611845848285016117cb565b600083015250604061185984828501611a31565b602083015250606061186d84828501611a31565b604083015250608061188184828501611a31565b60608301525060a061189584828501611a31565b60808301525060c082013567ffffffffffffffff8111156118b557600080fd5b6118c184828501611762565b60a08301525060e06118d584828501611a31565b60c0830152506101006118ea84828501611a31565b60e0830152506101206118ff84828501611a31565b6101008301525061014061191584828501611a31565b6101208301525061016061192b84828501611a31565b6101408301525061018061194184828501611a31565b610160830152506101a06119578482850161178c565b6101808301525092915050565b600060a0828403121561197657600080fd5b61198060a0611fed565b9050600082013567ffffffffffffffff81111561199c57600080fd5b6119a8848285016117a1565b600083015250602082013567ffffffffffffffff8111156119c857600080fd5b6119d4848285016117a1565b60208301525060406119e88482850161174d565b60408301525060606119fc84828501611a1c565b6060830152506080611a1084828501611a1c565b60808301525092915050565b600081359050611a2b8161246f565b92915050565b600081359050611a4081612486565b92915050565b600060208284031215611a5857600080fd5b6000611a668482850161174d565b91505092915050565b600060208284031215611a8157600080fd5b600082013567ffffffffffffffff811115611a9b57600080fd5b611aa784828501611817565b91505092915050565b600060208284031215611ac257600080fd5b6000611ad084828501611a31565b91505092915050565b6000611ae58383611b05565b60208301905092915050565b6000611afd8383611e36565b905092915050565b611b0e8161214c565b82525050565b6000611b1f8261208f565b611b2981856120ca565b9350611b348361206f565b8060005b83811015611b65578151611b4c8882611ad9565b9750611b57836120b0565b925050600181019050611b38565b5085935050505092915050565b6000611b7d8261209a565b611b8781856120db565b935083602082028501611b998561207f565b8060005b85811015611bd55784840389528151611bb68582611af1565b9450611bc1836120bd565b925060208a01995050600181019050611b9d565b50829750879550505050505092915050565b611bf08161215e565b82525050565b611bff8161216a565b82525050565b6000611c10826120a5565b611c1a81856120ec565b9350611c2a8185602086016121d1565b611c338161233d565b840191505092915050565b6000611c4b6013836120fd565b9150611c568261234e565b602082019050919050565b6000611c6e6019836120fd565b9150611c7982612377565b602082019050919050565b6000611c91601b836120fd565b9150611c9c826123a0565b602082019050919050565b6000611cb46017836120fd565b9150611cbf826123c9565b602082019050919050565b6000611cd76021836120fd565b9150611ce2826123f2565b604082019050919050565b604082016000820151611d036000850182611ed1565b506020820151611d166020850182611ed1565b50505050565b60006101c083016000830151611d356000860182611ced565b506020830151611d486040860182611ed1565b506040830151611d5b6060860182611ed1565b506060830151611d6e6080860182611ed1565b506080830151611d8160a0860182611ed1565b5060a083015184820360c0860152611d998282611b72565b91505060c0830151611dae60e0860182611ed1565b5060e0830151611dc2610100860182611ed1565b50610100830151611dd7610120860182611ed1565b50610120830151611dec610140860182611ed1565b50610140830151611e01610160860182611ed1565b50610160830151611e16610180860182611ed1565b50610180830151611e2b6101a0860182611bf6565b508091505092915050565b600060a0830160008301518482036000860152611e538282611c05565b91505060208301518482036020860152611e6d8282611c05565b9150506040830151611e826040860182611b05565b506060830151611e956060860182611ec2565b506080830151611ea86080860182611ec2565b508091505092915050565b611ebc81612194565b82525050565b611ecb8161219e565b82525050565b611eda816121ae565b82525050565b60006040820190508181036000830152611efa8185611b14565b9050611f096020830184611eb3565b9392505050565b6000602082019050611f256000830184611be7565b92915050565b60006020820190508181036000830152611f4481611c3e565b9050919050565b60006020820190508181036000830152611f6481611c61565b9050919050565b60006020820190508181036000830152611f8481611c84565b9050919050565b60006020820190508181036000830152611fa481611ca7565b9050919050565b60006020820190508181036000830152611fc481611cca565b9050919050565b60006020820190508181036000830152611fe58184611d1c565b905092915050565b6000611ff7612008565b90506120038282612236565b919050565b6000604051905090565b600067ffffffffffffffff82111561202d5761202c61230e565b5b602082029050602081019050919050565b600067ffffffffffffffff8211156120595761205861230e565b5b6120628261233d565b9050602081019050919050565b6000819050602082019050919050565b6000819050602082019050919050565b600081519050919050565b600081519050919050565b600081519050919050565b6000602082019050919050565b6000602082019050919050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b600082825260208201905092915050565b6000612119826121ae565b9150612124836121ae565b92508267ffffffffffffffff03821115612141576121406122b0565b5b828201905092915050565b600061215782612174565b9050919050565b60008115159050919050565b6000819050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600063ffffffff82169050919050565b600067ffffffffffffffff82169050919050565b82818337600083830152505050565b60005b838110156121ef5780820151818401526020810190506121d4565b838111156121fe576000848401525b50505050565b6000600282049050600182168061221c57607f821691505b602082108114156122305761222f6122df565b5b50919050565b61223f8261233d565b810181811067ffffffffffffffff8211171561225e5761225d61230e565b5b80604052505050565b600061227282612194565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156122a5576122a46122b0565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b7f666174616c2f696e76616c69642065706f636800000000000000000000000000600082015250565b7f666174616c2f646973636f6e74696e756f75732065706f636800000000000000600082015250565b7f666174616c2f646973636f6e74696e756f75732076657273696f6e0000000000600082015250565b7f666174616c2f6e6f6e2d696e64657865642065706f6368000000000000000000600082015250565b7f666174616c2f76657269666965725f6c69737420686173206e6f2073656e646560008201527f7200000000000000000000000000000000000000000000000000000000000000602082015250565b61244a8161214c565b811461245557600080fd5b50565b6124618161216a565b811461246c57600080fd5b50565b6124788161219e565b811461248357600080fd5b50565b61248f816121ae565b811461249a57600080fd5b5056fea2646970667358221220c88b6bc03c154ae7a206d7128536b9f3a8bfb65e83ae681b1fd9073d98ee950a64736f6c63430008040033", + "bytecode": "", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/src/assets/MirrorToken.json b/src/assets/MirrorToken.json deleted file mode 100644 index 3f835ac..0000000 --- a/src/assets/MirrorToken.json +++ /dev/null @@ -1,606 +0,0 @@ -{ - "_format": "hh-sol-artifact-1", - "contractName": "MirrorToken", - "sourceName": "contracts/MirrorToken.sol", - "abi": [ - { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint8", - "name": "decimals_", - "type": "uint8" - } - ], - "stateMutability": "nonpayable", - "type": "constructor" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Approval", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "previousOwner", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "OwnershipTransferred", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "previousAdminRole", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "bytes32", - "name": "newAdminRole", - "type": "bytes32" - } - ], - "name": "RoleAdminChanged", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleGranted", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "indexed": true, - "internalType": "address", - "name": "account", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "sender", - "type": "address" - } - ], - "name": "RoleRevoked", - "type": "event" - }, - { - "anonymous": false, - "inputs": [ - { - "indexed": true, - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "indexed": true, - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "indexed": false, - "internalType": "uint256", - "name": "value", - "type": "uint256" - } - ], - "name": "Transfer", - "type": "event" - }, - { - "inputs": [], - "name": "DEFAULT_ADMIN_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "MANAGER_ROLE", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "owner", - "type": "address" - }, - { - "internalType": "address", - "name": "spender", - "type": "address" - } - ], - "name": "allowance", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "approve", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "balanceOf", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "burn", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "decimals", - "outputs": [ - { - "internalType": "uint8", - "name": "", - "type": "uint8" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "subtractedValue", - "type": "uint256" - } - ], - "name": "decreaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - } - ], - "name": "getRoleAdmin", - "outputs": [ - { - "internalType": "bytes32", - "name": "", - "type": "bytes32" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "grantRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "hasRole", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "spender", - "type": "address" - }, - { - "internalType": "uint256", - "name": "addedValue", - "type": "uint256" - } - ], - "name": "increaseAllowance", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "mint", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [], - "name": "name", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "owner", - "outputs": [ - { - "internalType": "address", - "name": "", - "type": "address" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "renounceOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "renounceRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes32", - "name": "role", - "type": "bytes32" - }, - { - "internalType": "address", - "name": "account", - "type": "address" - } - ], - "name": "revokeRole", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "bytes4", - "name": "interfaceId", - "type": "bytes4" - } - ], - "name": "supportsInterface", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "symbol", - "outputs": [ - { - "internalType": "string", - "name": "", - "type": "string" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [], - "name": "totalSupply", - "outputs": [ - { - "internalType": "uint256", - "name": "", - "type": "uint256" - } - ], - "stateMutability": "view", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transfer", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "from", - "type": "address" - }, - { - "internalType": "address", - "name": "to", - "type": "address" - }, - { - "internalType": "uint256", - "name": "amount", - "type": "uint256" - } - ], - "name": "transferFrom", - "outputs": [ - { - "internalType": "bool", - "name": "", - "type": "bool" - } - ], - "stateMutability": "nonpayable", - "type": "function" - }, - { - "inputs": [ - { - "internalType": "address", - "name": "newOwner", - "type": "address" - } - ], - "name": "transferOwnership", - "outputs": [], - "stateMutability": "nonpayable", - "type": "function" - } - ], - "bytecode": "0x60806040523480156200001157600080fd5b5060405162002f6838038062002f6883398181016040528101906200003791906200044f565b828281600390805190602001906200005192919062000316565b5080600490805190602001906200006a92919062000316565b5050506200008d62000081620000d560201b60201c565b620000dd60201b60201c565b620000b16000801b620000a5620000d560201b60201c565b620001a360201b60201c565b80600660146101000a81548160ff021916908360ff1602179055505050506200066e565b600033905090565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b620001b58282620001b960201b60201c565b5050565b620001cb8282620002ab60201b60201c565b620002a75760016005600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506200024c620000d560201b60201c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b60006005600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b828054620003249062000579565b90600052602060002090601f01602090048101928262000348576000855562000394565b82601f106200036357805160ff191683800117855562000394565b8280016001018555821562000394579182015b828111156200039357825182559160200191906001019062000376565b5b509050620003a39190620003a7565b5090565b5b80821115620003c2576000816000905550600101620003a8565b5090565b6000620003dd620003d78462000500565b620004d7565b905082815260208101848484011115620003f657600080fd5b6200040384828562000543565b509392505050565b600082601f8301126200041d57600080fd5b81516200042f848260208601620003c6565b91505092915050565b600081519050620004498162000654565b92915050565b6000806000606084860312156200046557600080fd5b600084015167ffffffffffffffff8111156200048057600080fd5b6200048e868287016200040b565b935050602084015167ffffffffffffffff811115620004ac57600080fd5b620004ba868287016200040b565b9250506040620004cd8682870162000438565b9150509250925092565b6000620004e3620004f6565b9050620004f18282620005af565b919050565b6000604051905090565b600067ffffffffffffffff8211156200051e576200051d62000614565b5b620005298262000643565b9050602081019050919050565b600060ff82169050919050565b60005b838110156200056357808201518184015260208101905062000546565b8381111562000573576000848401525b50505050565b600060028204905060018216806200059257607f821691505b60208210811415620005a957620005a8620005e5565b5b50919050565b620005ba8262000643565b810181811067ffffffffffffffff82111715620005dc57620005db62000614565b5b80604052505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6000601f19601f8301169050919050565b6200065f8162000536565b81146200066b57600080fd5b50565b6128ea806200067e6000396000f3fe608060405234801561001057600080fd5b50600436106101585760003560e01c8063715018a6116100c3578063a457c2d71161007c578063a457c2d7146103db578063a9059cbb1461040b578063d547741f1461043b578063dd62ed3e14610457578063ec87621c14610487578063f2fde38b146104a557610158565b8063715018a61461032b5780638da5cb5b1461033557806391d148541461035357806395d89b41146103835780639dc29fac146103a1578063a217fddf146103bd57610158565b80632f2ff15d116101155780632f2ff15d14610259578063313ce5671461027557806336568abe1461029357806339509351146102af57806340c10f19146102df57806370a08231146102fb57610158565b806301ffc9a71461015d57806306fdde031461018d578063095ea7b3146101ab57806318160ddd146101db57806323b872dd146101f9578063248a9ca314610229575b600080fd5b61017760048036038101906101729190611c07565b6104c1565b6040516101849190611f6a565b60405180910390f35b61019561053b565b6040516101a29190611fa0565b60405180910390f35b6101c560048036038101906101c09190611b66565b6105cd565b6040516101d29190611f6a565b60405180910390f35b6101e36105f0565b6040516101f09190612182565b60405180910390f35b610213600480360381019061020e9190611b17565b6105fa565b6040516102209190611f6a565b60405180910390f35b610243600480360381019061023e9190611ba2565b610629565b6040516102509190611f85565b60405180910390f35b610273600480360381019061026e9190611bcb565b610649565b005b61027d61066a565b60405161028a919061219d565b60405180910390f35b6102ad60048036038101906102a89190611bcb565b610681565b005b6102c960048036038101906102c49190611b66565b610704565b6040516102d69190611f6a565b60405180910390f35b6102f960048036038101906102f49190611b66565b61073b565b005b61031560048036038101906103109190611ab2565b610774565b6040516103229190612182565b60405180910390f35b6103336107bc565b005b61033d6107d0565b60405161034a9190611f4f565b60405180910390f35b61036d60048036038101906103689190611bcb565b6107fa565b60405161037a9190611f6a565b60405180910390f35b61038b610865565b6040516103989190611fa0565b60405180910390f35b6103bb60048036038101906103b69190611b66565b6108f7565b005b6103c5610930565b6040516103d29190611f85565b60405180910390f35b6103f560048036038101906103f09190611b66565b610937565b6040516104029190611f6a565b60405180910390f35b61042560048036038101906104209190611b66565b6109ae565b6040516104329190611f6a565b60405180910390f35b61045560048036038101906104509190611bcb565b6109d1565b005b610471600480360381019061046c9190611adb565b6109f2565b60405161047e9190612182565b60405180910390f35b61048f610a79565b60405161049c9190611f85565b60405180910390f35b6104bf60048036038101906104ba9190611ab2565b610a9d565b005b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610534575061053382610b21565b5b9050919050565b60606003805461054a906123ab565b80601f0160208091040260200160405190810160405280929190818152602001828054610576906123ab565b80156105c35780601f10610598576101008083540402835291602001916105c3565b820191906000526020600020905b8154815290600101906020018083116105a657829003601f168201915b5050505050905090565b6000806105d8610b8b565b90506105e5818585610b93565b600191505092915050565b6000600254905090565b600080610605610b8b565b9050610612858285610d5e565b61061d858585610dea565b60019150509392505050565b600060056000838152602001908152602001600020600101549050919050565b61065282610629565b61065b8161106b565b610665838361107f565b505050565b6000600660149054906101000a900460ff16905090565b610689610b8b565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16146106f6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ed90612142565b60405180910390fd5b6107008282611160565b5050565b60008061070f610b8b565b905061073081858561072185896109f2565b61072b91906121df565b610b93565b600191505092915050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b086107658161106b565b61076f8383611242565b505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6107c46113a2565b6107ce6000611420565b565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60006005600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b606060048054610874906123ab565b80601f01602080910402602001604051908101604052809291908181526020018280546108a0906123ab565b80156108ed5780601f106108c2576101008083540402835291602001916108ed565b820191906000526020600020905b8154815290600101906020018083116108d057829003601f168201915b5050505050905090565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b086109218161106b565b61092b83836114e6565b505050565b6000801b81565b600080610942610b8b565b9050600061095082866109f2565b905083811015610995576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098c90612122565b60405180910390fd5b6109a28286868403610b93565b60019250505092915050565b6000806109b9610b8b565b90506109c6818585610dea565b600191505092915050565b6109da82610629565b6109e38161106b565b6109ed8383611160565b505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b7f241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b0881565b610aa56113a2565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415610b15576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0c90612022565b60405180910390fd5b610b1e81611420565b50565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610c03576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bfa90612102565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610c73576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c6a90612042565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610d519190612182565b60405180910390a3505050565b6000610d6a84846109f2565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114610de45781811015610dd6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610dcd90612062565b60405180910390fd5b610de38484848403610b93565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff161415610e5a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e51906120e2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415610eca576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ec190611fe2565b60405180910390fd5b610ed58383836116bd565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610f5b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5290612082565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828254610fee91906121df565b925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516110529190612182565b60405180910390a36110658484846116c2565b50505050565b61107c81611077610b8b565b6116c7565b50565b61108982826107fa565b61115c5760016005600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550611101610b8b565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b61116a82826107fa565b1561123e5760006005600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055506111e3610b8b565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156112b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112a990612162565b60405180910390fd5b6112be600083836116bd565b80600260008282546112d091906121df565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461132591906121df565b925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161138a9190612182565b60405180910390a361139e600083836116c2565b5050565b6113aa610b8b565b73ffffffffffffffffffffffffffffffffffffffff166113c86107d0565b73ffffffffffffffffffffffffffffffffffffffff161461141e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611415906120a2565b60405180910390fd5b565b6000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff161415611556576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161154d906120c2565b60405180910390fd5b611562826000836116bd565b60008060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156115e8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115df90612002565b60405180910390fd5b8181036000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816002600082825461163f919061228f565b92505081905550600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef846040516116a49190612182565b60405180910390a36116b8836000846116c2565b505050565b505050565b505050565b6116d182826107fa565b611760576116f68173ffffffffffffffffffffffffffffffffffffffff166014611764565b6117048360001c6020611764565b604051602001611715929190611f15565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117579190611fa0565b60405180910390fd5b5050565b6060600060028360026117779190612235565b61178191906121df565b67ffffffffffffffff8111156117c0577f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040519080825280601f01601f1916602001820160405280156117f25781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110611850577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f7800000000000000000000000000000000000000000000000000000000000000816001815181106118da577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053506000600184600261191a9190612235565b61192491906121df565b90505b6001811115611a10577f3031323334353637383961626364656600000000000000000000000000000000600f86166010811061198c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b1a60f81b8282815181106119c9577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080611a0990612381565b9050611927565b5060008414611a54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4b90611fc2565b60405180910390fd5b8091505092915050565b600081359050611a6d81612858565b92915050565b600081359050611a828161286f565b92915050565b600081359050611a9781612886565b92915050565b600081359050611aac8161289d565b92915050565b600060208284031215611ac457600080fd5b6000611ad284828501611a5e565b91505092915050565b60008060408385031215611aee57600080fd5b6000611afc85828601611a5e565b9250506020611b0d85828601611a5e565b9150509250929050565b600080600060608486031215611b2c57600080fd5b6000611b3a86828701611a5e565b9350506020611b4b86828701611a5e565b9250506040611b5c86828701611a9d565b9150509250925092565b60008060408385031215611b7957600080fd5b6000611b8785828601611a5e565b9250506020611b9885828601611a9d565b9150509250929050565b600060208284031215611bb457600080fd5b6000611bc284828501611a73565b91505092915050565b60008060408385031215611bde57600080fd5b6000611bec85828601611a73565b9250506020611bfd85828601611a5e565b9150509250929050565b600060208284031215611c1957600080fd5b6000611c2784828501611a88565b91505092915050565b611c39816122c3565b82525050565b611c48816122d5565b82525050565b611c57816122e1565b82525050565b6000611c68826121b8565b611c7281856121c3565b9350611c8281856020860161234e565b611c8b8161243b565b840191505092915050565b6000611ca1826121b8565b611cab81856121d4565b9350611cbb81856020860161234e565b80840191505092915050565b6000611cd46020836121c3565b9150611cdf8261244c565b602082019050919050565b6000611cf76023836121c3565b9150611d0282612475565b604082019050919050565b6000611d1a6022836121c3565b9150611d25826124c4565b604082019050919050565b6000611d3d6026836121c3565b9150611d4882612513565b604082019050919050565b6000611d606022836121c3565b9150611d6b82612562565b604082019050919050565b6000611d83601d836121c3565b9150611d8e826125b1565b602082019050919050565b6000611da66026836121c3565b9150611db1826125da565b604082019050919050565b6000611dc96020836121c3565b9150611dd482612629565b602082019050919050565b6000611dec6021836121c3565b9150611df782612652565b604082019050919050565b6000611e0f6025836121c3565b9150611e1a826126a1565b604082019050919050565b6000611e326024836121c3565b9150611e3d826126f0565b604082019050919050565b6000611e556017836121d4565b9150611e608261273f565b601782019050919050565b6000611e786025836121c3565b9150611e8382612768565b604082019050919050565b6000611e9b6011836121d4565b9150611ea6826127b7565b601182019050919050565b6000611ebe602f836121c3565b9150611ec9826127e0565b604082019050919050565b6000611ee1601f836121c3565b9150611eec8261282f565b602082019050919050565b611f0081612337565b82525050565b611f0f81612341565b82525050565b6000611f2082611e48565b9150611f2c8285611c96565b9150611f3782611e8e565b9150611f438284611c96565b91508190509392505050565b6000602082019050611f646000830184611c30565b92915050565b6000602082019050611f7f6000830184611c3f565b92915050565b6000602082019050611f9a6000830184611c4e565b92915050565b60006020820190508181036000830152611fba8184611c5d565b905092915050565b60006020820190508181036000830152611fdb81611cc7565b9050919050565b60006020820190508181036000830152611ffb81611cea565b9050919050565b6000602082019050818103600083015261201b81611d0d565b9050919050565b6000602082019050818103600083015261203b81611d30565b9050919050565b6000602082019050818103600083015261205b81611d53565b9050919050565b6000602082019050818103600083015261207b81611d76565b9050919050565b6000602082019050818103600083015261209b81611d99565b9050919050565b600060208201905081810360008301526120bb81611dbc565b9050919050565b600060208201905081810360008301526120db81611ddf565b9050919050565b600060208201905081810360008301526120fb81611e02565b9050919050565b6000602082019050818103600083015261211b81611e25565b9050919050565b6000602082019050818103600083015261213b81611e6b565b9050919050565b6000602082019050818103600083015261215b81611eb1565b9050919050565b6000602082019050818103600083015261217b81611ed4565b9050919050565b60006020820190506121976000830184611ef7565b92915050565b60006020820190506121b26000830184611f06565b92915050565b600081519050919050565b600082825260208201905092915050565b600081905092915050565b60006121ea82612337565b91506121f583612337565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0382111561222a576122296123dd565b5b828201905092915050565b600061224082612337565b915061224b83612337565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0483118215151615612284576122836123dd565b5b828202905092915050565b600061229a82612337565b91506122a583612337565b9250828210156122b8576122b76123dd565b5b828203905092915050565b60006122ce82612317565b9050919050565b60008115159050919050565b6000819050919050565b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b600060ff82169050919050565b60005b8381101561236c578082015181840152602081019050612351565b8381111561237b576000848401525b50505050565b600061238c82612337565b915060008214156123a05761239f6123dd565b5b600182039050919050565b600060028204905060018216806123c357607f821691505b602082108114156123d7576123d661240c565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000601f19601f8301169050919050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60008201527f6365000000000000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360008201527f7300000000000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b612861816122c3565b811461286c57600080fd5b50565b612878816122e1565b811461288357600080fd5b50565b61288f816122eb565b811461289a57600080fd5b50565b6128a681612337565b81146128b157600080fd5b5056fea2646970667358221220ea47e4efe0a3c37dd62f6ab43e2d14393d14b0a0a6c9777ec0fda51cd6d0be3264736f6c63430008040033", - "linkReferences": {}, - "deployedLinkReferences": {} -} diff --git a/src/assets/config_template.toml b/src/assets/config_template.toml index 9ee66fd..9fb931b 100644 --- a/src/assets/config_template.toml +++ b/src/assets/config_template.toml @@ -6,15 +6,48 @@ data_path = "./nodes/{DATA_PATH}" epoch_len = 100_000_000 -metadata_contract_address = "{METADATA_CONTRACT_ADDRESS}" -crosschain_contract_address = "{CROSS_CHAIN_CONTRACT_ADDRESS}" -wckb_contract_address = "{WCKB_CONTRACT_ADDRESS}" +[[accounts]] +address = "0xa0ee7a142d267c1f36714e4a8f75612f20a79720" +balance = "04ee2d6d415b85acef8100000000" + +[[accounts]] +address = "0xf39fd6e51aad88f6f4ce6ab8827279cfffb92266" +balance = "04ee2d6d415b85acef8100000000" + +[[accounts]] +address = "0x70997970C51812dc3A010C7d01b50e0d17dc79C8" +balance = "04ee2d6d415b85acef8100000000" + +[[accounts]] +address = "0x3C44CdDdB6a900fa2b585dd299e03d12FA4293BC" +balance = "04ee2d6d415b85acef8100000000" + +[[accounts]] +address = "0x90F79bf6EB2c4f870365E785982E1f101E93b906" +balance = "04ee2d6d415b85acef8100000000" + +[[accounts]] +address = "0x15d34AAf54267DB7D7c367839AAf71A00a2C6A65" +balance = "04ee2d6d415b85acef8100000000" + +[[accounts]] +address = "0x9965507D1a55bcC2695C58ba16FB37d819B0A4dc" +balance = "04ee2d6d415b85acef8100000000" + +[[accounts]] +address = "0x976EA74026E726554dB657fA54763abd0C3a0aa9" +balance = "04ee2d6d415b85acef8100000000" + +[[accounts]] +address = "0x14dC79964da2C08b23698B3D3cc7Ca32193d9955" +balance = "04ee2d6d415b85acef8100000000" + +[[accounts]] +address = "0x23618e81E3f5cdF7f54C3d65f7FBc0aBf5B21E8f" +balance = "04ee2d6d415b85acef8100000000" [accounts] -mnemonic = "test test test test test test test test test test test junk" -# initial_index = 0 -# path = "m/44'/60'/0'/0" -count = 10 +address = {INIT_DISTRIBUTE_ADDRESS} balance = "04ee2d6d415b85acef8100000000" [rpc] @@ -24,6 +57,10 @@ maxconn = 25000 max_payload_size = 10485760 client_version = "0.1.0" +[web3] +max_gas_cap = 50_000_000 +log_filter_max_block_range = 25000 + [network] listening_address = "/ip4/0.0.0.0/tcp/8001" rpc_timeout = 10 diff --git a/src/axon_nodes/config.rs b/src/axon_nodes/config.rs index 585d5fc..b6f8f49 100644 --- a/src/axon_nodes/config.rs +++ b/src/axon_nodes/config.rs @@ -6,13 +6,13 @@ use std::{ use axon_protocol::{ codec::hex_decode, types::{ - Address, Eip1559Transaction, Hasher, Hex, SignedTransaction, TransactionAction, + Address, Eip1559Transaction, Hasher, Hex, Metadata, SignedTransaction, TransactionAction, UnsignedTransaction, UnverifiedTransaction, ValidatorExtend, H160, U256, }, }; +use axon_tools::consts::METADATA_CONTRACT_ADDRESS; use clap::Args; -use ethers_core::abi::{Contract, Token}; -use log::{error, info}; +use ethers_core::abi::Token; use ophelia::{PrivateKey, PublicKey, Signature, ToBlsPublicKey}; use ophelia_blst::BlsPrivateKey; use ophelia_secp256k1::Secp256k1RecoverablePrivateKey; @@ -22,10 +22,8 @@ use tentacle_secio::SecioKeyPair; use crate::{ constants::{ - CONFIG_TEMPLATE, CROSS_CHAIN_ABI, CROSS_CHAIN_CONTRACT, DB_OPTION_TEMPLATE, - DEFAULT_NODES_PATH, DEFAULT_NODE_KEY_PAIRS_PATH, GENESIS_TEMPLATE, METADATA_ABI, - METADATA_CONTRACT, METADATA_TEMPLATE, PROXY_ABI, PROXY_CONTRACT, TOKEN_ABI, TOKEN_CONTRACT, - VALIDATOR_TEMPLATE, + CONFIG_TEMPLATE, DB_OPTION_TEMPLATE, DEFAULT_NODES_PATH, DEFAULT_NODE_KEY_PAIRS_PATH, + GENESIS_TEMPLATE, METADATA_ABI, METADATA_TEMPLATE, VALIDATOR_TEMPLATE, }, types::Result, utils::{ @@ -37,12 +35,10 @@ use crate::{ pub struct KeygenArgs { /// number of key pairs #[clap(short, long, default_value = "1")] - number: u32, - + number: u32, /// the output path for key pairs file #[clap(short, long, default_value=*DEFAULT_NODE_KEY_PAIRS_PATH)] - path: String, - + path: String, /// private keys are seperated by ',', extra keys will be randomly generated #[clap(short = 'P', long, value_delimiter = ',')] private_keys: Vec, @@ -52,35 +48,31 @@ pub struct KeygenArgs { pub struct ConfigGenArgs { /// the output path of config files #[clap(short, long, default_value=*DEFAULT_NODES_PATH)] - path: String, - + path: String, /// the path of key pairs file #[clap(short, long, default_value=*DEFAULT_NODE_KEY_PAIRS_PATH)] key_pairs_path: String, - /// the p2p address of nodes #[clap(short, long, value_delimiter = ',')] - addresses: Vec, + addresses: Vec, + /// the epoch length + #[clap(short, long, default_value = "1000000")] + epoch_len: u64, } -#[derive(Serialize, Deserialize, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Clone)] +#[derive(Serialize, Deserialize, Default, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] struct KeyPair { - bls_private_key: Hex, - - bls_public_key: Hex, - + bls_private_key: Hex, + bls_public_key: Hex, secp256k1_public_key: Hex, - - address: H160, - - peer_id: String, + address: H160, + peer_id: String, } -#[derive(Serialize, Deserialize, Debug, Default, PartialEq, Eq, PartialOrd, Ord, Clone)] +#[derive(Serialize, Deserialize, Default, Clone, Debug, PartialEq, Eq, PartialOrd, Ord)] struct KeyPairsList { common_ref: String, - - key_pairs: Vec, + key_pairs: Vec, } fn get_key_pair_from_private_key( @@ -141,7 +133,7 @@ pub fn generate_key_pairs(args: &KeygenArgs) -> Result<()> { path, )?; - info!("Key pairs generated"); + log::info!("Key pairs generated"); Ok(()) } @@ -149,7 +141,7 @@ pub fn generate_key_pairs(args: &KeygenArgs) -> Result<()> { pub fn log_key_pairs(path: impl AsRef) -> Result<()> { let key_pairs_list: KeyPairsList = from_json_file(path)?; - info!("Key pairs logged to stdout (to avoid being recorded)"); + log::info!("Key pairs logged to stdout (to avoid being recorded)"); println!("{}", serde_json::to_string_pretty(&key_pairs_list)?); Ok(()) @@ -179,29 +171,20 @@ fn sign_tx( chain_id: u64, ) -> SignedTransaction { let signature = private_key.sign_message( - &Hasher::digest(tx.encode(chain_id, None)) + &Hasher::digest(tx.encode(Some(chain_id), None)) .as_bytes() .try_into() .unwrap(), ); let utx = UnverifiedTransaction { - unsigned: tx, + unsigned: tx, signature: Some(signature.to_bytes().into()), - chain_id, - hash: Default::default(), + chain_id: Some(chain_id), + hash: Default::default(), } .calc_hash(); - utx.try_into().unwrap() -} - -fn contract_address(address: &H160, nonce: u32) -> H160 { - contract_address::ContractAddress::from_sender_and_nonce( - &address.as_fixed_bytes().into(), - &nonce.into(), - ) - .as_fixed_bytes() - .into() + SignedTransaction::from_unverified(utx, None).unwrap() } pub fn generate_configs(args: &ConfigGenArgs) -> Result<()> { @@ -209,6 +192,7 @@ pub fn generate_configs(args: &ConfigGenArgs) -> Result<()> { key_pairs_path, path: path_str, addresses, + epoch_len, } = args; let path: &Path = path_str.as_ref(); @@ -238,7 +222,7 @@ pub fn generate_configs(args: &ConfigGenArgs) -> Result<()> { let first_key_pair = if let Some(key_pair) = key_pairs.first() { key_pair } else { - error!("No key pair provided, see \"axon keygen\" to generate key pairs"); + log::error!("No key pair provided, see \"axon keygen\" to generate key pairs"); return Ok(()); }; @@ -270,141 +254,26 @@ pub fn generate_configs(args: &ConfigGenArgs) -> Result<()> { )?; let address = first_key_pair.address; - let metadata_address = contract_address(&address, 0); - let wckb_address = contract_address(&address, 1); - let metadata_proxy_address = contract_address(&address, 2); - let cross_chain_address = contract_address(&address, 3); - let cross_chain_proxy_address = contract_address(&address, 5); - - let deploy_metadata = get_tx( + let append_metadata_1 = get_tx( fee_per_gas, 0, - TransactionAction::Create, - hex_decode(METADATA_CONTRACT.bytecode)?, - ); - - let deploy_token_data = - TOKEN_ABI - .constructor() - .unwrap() - .encode_input(hex_decode(TOKEN_CONTRACT.bytecode)?, &[ - Token::String("wCKB".to_string()), - Token::String("wCKB".to_string()), - Token::Uint(8.into()), - ])?; - let deploy_token = get_tx(fee_per_gas, 1, TransactionAction::Create, deploy_token_data); - - let construct_metadata_data = METADATA_ABI.function("construct")?.encode_input(&[])?; - let deploy_metadata_proxy_data = - PROXY_ABI - .constructor() - .unwrap() - .encode_input(hex_decode(PROXY_CONTRACT.bytecode)?, &[ - Token::Address(metadata_address), - Token::Bytes(construct_metadata_data), - ])?; - let deploy_metadata_proxy = get_tx( - fee_per_gas, - 2, - TransactionAction::Create, - deploy_metadata_proxy_data, - ); - - let deploy_cross_chain = get_tx( - fee_per_gas, - 3, - TransactionAction::Create, - hex_decode(CROSS_CHAIN_CONTRACT.bytecode)?, - ); - - let append_metadata_data = - METADATA_ABI - .function("appendMetadata")? - .encode_input(&[Token::Tuple(vec![ - Token::Tuple(vec![ - Token::Uint(metadata.version.start.into()), - Token::Uint(metadata.version.end.into()), - ]), - Token::Uint(metadata.epoch.into()), - Token::Uint(metadata.gas_limit.into()), - Token::Uint(metadata.gas_price.into()), - Token::Uint(metadata.interval.into()), - Token::Array( - metadata - .verifier_list - .iter() - .map(|ve| { - Token::Tuple(vec![ - Token::Bytes(ve.bls_pub_key.as_bytes().to_vec()), - Token::Bytes(ve.pub_key.as_bytes().to_vec()), - Token::Address(ve.address), - Token::Uint(ve.propose_weight.into()), - Token::Uint(ve.vote_weight.into()), - ]) - }) - .collect::>(), - ), - Token::Uint(metadata.propose_ratio.into()), - Token::Uint(metadata.prevote_ratio.into()), - Token::Uint(metadata.precommit_ratio.into()), - Token::Uint(metadata.brake_ratio.into()), - Token::Uint(metadata.tx_num_limit.into()), - Token::Uint(metadata.max_tx_size.into()), - Token::FixedBytes(metadata.last_checkpoint_block_hash.as_bytes().to_vec()), - ])])?; - let append_metadata = get_tx( - fee_per_gas, - 4, - TransactionAction::Call(metadata_proxy_address), - append_metadata_data, + TransactionAction::Call(METADATA_CONTRACT_ADDRESS), + build_append_metadata_call(&metadata, 0, epoch_len - 1, 0)?, ); - - let construct_cross_chain_data = CROSS_CHAIN_ABI.function("construct")?.encode_input(&[ - Token::Address(metadata_proxy_address), - Token::Address(wckb_address), - ])?; - let deploy_cross_chain_proxy_data = Contract::load(PROXY_CONTRACT.abi.get().as_bytes())? - .constructor() - .unwrap() - .encode_input(hex_decode(PROXY_CONTRACT.bytecode)?, &[ - Token::Address(cross_chain_address), - Token::Bytes(construct_cross_chain_data), - ])?; - let deploy_cross_chain_proxy = get_tx( - fee_per_gas, - 5, - TransactionAction::Create, - deploy_cross_chain_proxy_data, - ); - - let grant_role_data = TOKEN_ABI.function("grantRole")?.encode_input(&[ - Token::FixedBytes(hex_decode( - "241ecf16d79d0f8dbfb92cbc07fe17840425976cf0667f022fe9877caa831b08", - )?), - Token::Address(cross_chain_proxy_address), - ])?; - let grant_role = get_tx( + let append_metadata_2 = get_tx( fee_per_gas, - 6, - TransactionAction::Call(wckb_address), - grant_role_data, + 1, + TransactionAction::Call(METADATA_CONTRACT_ADDRESS), + build_append_metadata_call(&metadata, *epoch_len, epoch_len * 2 - 1, 1)?, ); - genesis.to_mut().txs = [ - deploy_metadata, - deploy_token, - deploy_metadata_proxy, - deploy_cross_chain, - append_metadata, - deploy_cross_chain_proxy, - grant_role, - ] - .into_iter() - .map(|tx| sign_tx(&private_key, tx, chain_id)) - .collect::>(); + genesis.to_mut().txs = [append_metadata_1, append_metadata_2] + .into_iter() + .map(|tx| sign_tx(&private_key, tx, chain_id)) + .collect::>(); to_json_file(&genesis, path.join("genesis.json"))?; - info!("Genesis file generated"); + log::info!("Genesis file generated"); let bootstraps = key_pairs.iter().enumerate().map(|(i, key_pair)| { let peer_id = &key_pair.peer_id; @@ -414,7 +283,7 @@ pub fn generate_configs(args: &ConfigGenArgs) -> Result<()> { } else { format!("[[network.bootstraps]]\nmulti_address = \"/ip4/172.17.0.1/tcp/{}/p2p/{peer_id}\"", 10000 + i) } - }).reduce(|a, b| format!("{a}\n{b}")).unwrap_or_else(|| "".to_string()); + }).reduce(|a, b| format!("{a}\n{b}")).unwrap_or_default(); key_pairs .iter() @@ -425,23 +294,54 @@ pub fn generate_configs(args: &ConfigGenArgs) -> Result<()> { let config = config .replace("{PRIVATE_KEY}", &bls_private_key.as_string()) .replace("{DATA_PATH}", &format!("data{index}")) - .replace( - "{METADATA_CONTRACT_ADDRESS}", - &format!("0x{metadata_proxy_address:x}"), - ) - .replace( - "{CROSS_CHAIN_CONTRACT_ADDRESS}", - &format!("0x{cross_chain_proxy_address:x}"), - ) - .replace("{WCKB_CONTRACT_ADDRESS}", &format!("0x{wckb_address:x}")) + .replace("{INIT_DISTRIBUTE_ADDRESS}", &format!("0x{address:x}")) .replace("{NETWORK_BOOTSTRAPS}", &bootstraps); write(path.join(format!("config_{index}.toml")), config.as_bytes())?; - info!("Config file {index} generated"); + log::info!("Config file {index} generated"); Result::Ok(()) })?; Ok(()) } + +fn build_append_metadata_call( + metadata: &Metadata, + start: u64, + end: u64, + epoch: u64, +) -> Result> { + Ok(METADATA_ABI + .function("appendMetadata")? + .encode_input(&[Token::Tuple(vec![ + Token::Tuple(vec![Token::Uint(start.into()), Token::Uint(end.into())]), + Token::Uint(epoch.into()), + Token::Uint(metadata.gas_limit.into()), + Token::Uint(metadata.gas_price.into()), + Token::Uint(metadata.interval.into()), + Token::Array( + metadata + .verifier_list + .iter() + .map(|ve| { + Token::Tuple(vec![ + Token::Bytes(ve.bls_pub_key.as_bytes().to_vec()), + Token::Bytes(ve.pub_key.as_bytes().to_vec()), + Token::Address(ve.address), + Token::Uint(ve.propose_weight.into()), + Token::Uint(ve.vote_weight.into()), + ]) + }) + .collect::>(), + ), + Token::Uint(metadata.propose_ratio.into()), + Token::Uint(metadata.prevote_ratio.into()), + Token::Uint(metadata.precommit_ratio.into()), + Token::Uint(metadata.brake_ratio.into()), + Token::Uint(metadata.tx_num_limit.into()), + Token::Uint(metadata.max_tx_size.into()), + Token::Array(vec![]), + ])])?) +} diff --git a/src/axon_nodes/mod.rs b/src/axon_nodes/mod.rs index de562f6..27865d1 100644 --- a/src/axon_nodes/mod.rs +++ b/src/axon_nodes/mod.rs @@ -61,7 +61,7 @@ enum AxonNodesActions { #[async_trait] impl SubCommand for AxonNodes { - fn get_command(&self) -> Command<'static> { + fn get_command(&self) -> Command { AxonNodesActions::augment_subcommands(Command::new("axon")).about("Manage Axon nodes") } diff --git a/src/benchmark.rs b/src/benchmark.rs index 5b9d0ec..7da720e 100644 --- a/src/benchmark.rs +++ b/src/benchmark.rs @@ -46,7 +46,7 @@ struct StartBenchmarkArgs { #[async_trait] impl SubCommand for Benchmark { - fn get_command(&self) -> Command<'static> { + fn get_command(&self) -> Command { BenchmarkActions::augment_subcommands(Command::new("benchmark")).about("Manage benchmark") } diff --git a/src/constants.rs b/src/constants.rs index c97562b..7932235 100644 --- a/src/constants.rs +++ b/src/constants.rs @@ -3,10 +3,7 @@ use ethers_core::abi::Contract; use include_dir::{include_dir, Dir}; use lazy_static::lazy_static; -use crate::{ - crosschain_tx::types::{CheckpointConfig, CreateSidechainConfigs, OmniConfig}, - types::ContractJson, -}; +use crate::types::ContractJson; pub const DEFAULT_AXON_NETWORK_NAME: &str = "axon-net"; pub const DEFAULT_AXON_DATA_VOLUME: &str = "axon-data"; @@ -24,10 +21,7 @@ pub fn string_to_static_str(s: String) -> &'static str { pub const BASE_FEE_PER_GAS: u64 = 0x539; -pub const CROSS_CHAIN_CONTRACT_JSON: &str = include_str!("./assets/CrossChain.json"); pub const METADATA_CONTRACT_JSON: &str = include_str!("./assets/MetadataManager.json"); -pub const TOKEN_CONTRACT_JSON: &str = include_str!("./assets/MirrorToken.json"); -pub const PROXY_CONTRACT_JSON: &str = include_str!("./assets/ERC1967Proxy.json"); pub const CONFIG_TEMPLATE: &str = include_str!("./assets/config_template.toml"); pub const DB_OPTION_TEMPLATE: &str = include_str!("./assets/default.db-options"); @@ -91,34 +85,10 @@ lazy_static! { verifier_list: vec![VALIDATOR_TEMPLATE.clone()], ..Default::default() }; - pub static ref CREATE_SIDECHAIN_CONFIG_TEMPLATE: CreateSidechainConfigs = - CreateSidechainConfigs { - checkpoint_config: CheckpointConfig { - base_reward: "0".to_string(), - ..Default::default() - }, - omni_config: OmniConfig { - max_supply: "0".to_string(), - ..Default::default() - }, - ..Default::default() - }; - pub static ref CROSS_CHAIN_CONTRACT: ContractJson<'static> = - serde_json::from_str(CROSS_CHAIN_CONTRACT_JSON).unwrap(); - pub static ref CROSS_CHAIN_ABI: Contract = - Contract::load(CROSS_CHAIN_CONTRACT.abi.get().as_bytes()).unwrap(); pub static ref METADATA_CONTRACT: ContractJson<'static> = serde_json::from_str(METADATA_CONTRACT_JSON).unwrap(); pub static ref METADATA_ABI: Contract = Contract::load(METADATA_CONTRACT.abi.get().as_bytes()).unwrap(); - pub static ref TOKEN_CONTRACT: ContractJson<'static> = - serde_json::from_str(TOKEN_CONTRACT_JSON).unwrap(); - pub static ref TOKEN_ABI: Contract = - Contract::load(TOKEN_CONTRACT.abi.get().as_bytes()).unwrap(); - pub static ref PROXY_CONTRACT: ContractJson<'static> = - serde_json::from_str(PROXY_CONTRACT_JSON).unwrap(); - pub static ref PROXY_ABI: Contract = - Contract::load(PROXY_CONTRACT.abi.get().as_bytes()).unwrap(); } pub const AXON_IMAGE_NAME: &str = "hanssen0/axon"; diff --git a/src/crosschain_tx/cells.rs b/src/crosschain_tx/cells.rs deleted file mode 100644 index a361c52..0000000 --- a/src/crosschain_tx/cells.rs +++ /dev/null @@ -1,144 +0,0 @@ -use blake2b_rs::Blake2bBuilder; -use ckb_sdk::constants::TYPE_ID_CODE_HASH; -use ckb_types::{ - bytes::Bytes, - core::{Capacity, ScriptHashType}, - h256, - packed::{self, CellOutput, CellOutputBuilder, Script, ScriptBuilder}, - prelude::*, - H256, -}; -use lazy_static::lazy_static; - -use super::schema::{ - CheckpointLockArgsBuilder, CheckpointLockCellDataBuilder, OmniDataBuilder, OmniLockArgsBuilder, - SelectionLockArgsBuilder, StakeLockArgsBuilder, StakeLockCellDataBuilder, -}; -use crate::types::Result; - -pub const CKB_HASH_PERSONALIZATION: &[u8] = b"ckb-default-hash"; - -lazy_static! { - pub static ref OMNI_CODE_HASH: H256 = - h256!("0x79f90bb5e892d80dd213439eeab551120eb417678824f282b4ffb5f21bad2e1e"); - pub static ref CHECKPOINT_CODE_HASH: H256 = - h256!("0xd224d5e5d26d67c0b0ffb9b32cb7de3d32e8270a921c96dd70ee4cdb1418278a"); - pub static ref STAKE_CODE_HASH: H256 = - h256!("0x951a3594d46e087eb118448075864da309b88f1eefb0c173ef8480a46027b9d5"); - pub static ref SELECTION_CODE_HASH: H256 = - h256!("0xd799aa64646feae5a1df6379a40514797c628e0cfe2af1362d817e1ff823c1c6"); - pub static ref SECP256K1_BLAKE160_CODE_HASH: H256 = - h256!("0x9bd7e06f3ecf4be0f2fcd2188b23f1b9fcc88e5d4b65a8637b17723bbda3cce8"); - pub static ref SUDT_CODE_HASH: H256 = - h256!("0xc5e5dcf215925f7ef4dfaf5f4b4f105bc321c02776d6e7d52a1db3fcd9d011a4"); -} - -pub fn get_type_script_builder(code_hash: &H256) -> ScriptBuilder { - ScriptBuilder::default() - .hash_type(ScriptHashType::Type.into()) - .code_hash(code_hash.pack()) -} - -pub fn build_sudt_script(args: packed::Bytes) -> Script { - get_type_script_builder(&SUDT_CODE_HASH).args(args).build() -} - -pub fn build_type_id_script(first_input_out_point: &packed::CellInput, cell_index: u64) -> Script { - let mut args = [0u8; 32]; - let mut blake2b = Blake2bBuilder::new(32) - .personal(CKB_HASH_PERSONALIZATION) - .build(); - - blake2b.update(first_input_out_point.as_slice()); - blake2b.update(&cell_index.to_le_bytes()); - blake2b.finalize(&mut args); - - get_type_script_builder(&TYPE_ID_CODE_HASH) - .args(args.as_ref().pack()) - .build() -} - -#[derive(Default)] -pub struct OutputCellBuilder { - pub lock_builder: ScriptBuilder, - pub lock_args_builder: Option, - pub type_: Option