From 4c582bef50831d82beaa1affbf50bf572658234c Mon Sep 17 00:00:00 2001 From: Software Engineer Date: Thu, 13 Jun 2024 12:24:58 +0200 Subject: [PATCH] Benchmark script update (#101) * test: update benchmark * refactor: remove redundant comment --- scripts/local-node.sh | 1 + sgxvm/src/backend.rs | 3 - tests/tx-benchmark/.env.example | 2 +- tests/tx-benchmark/contracts/ERC20Token.json | 82 ++++++++++---------- tests/tx-benchmark/index.js | 39 ++++++---- tests/tx-benchmark/package.json | 2 +- 6 files changed, 69 insertions(+), 60 deletions(-) diff --git a/scripts/local-node.sh b/scripts/local-node.sh index ecf0b60f..2d2a51a2 100755 --- a/scripts/local-node.sh +++ b/scripts/local-node.sh @@ -34,6 +34,7 @@ echo "cup hip eyebrow flock slogan filter gas tent angle purpose rose setup" | s swisstronikd init $MONIKER -o --chain-id $CHAINID --home "$HOMEDIR" +jq '.app_state["feemarket"]["params"]["base_fee"]="7"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" jq '.app_state["staking"]["params"]["bond_denom"]="aswtr"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" jq '.app_state["staking"]["params"]["unbonding_time"]="1s"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" jq '.app_state["crisis"]["constant_fee"]["denom"]="aswtr"' "$GENESIS" >"$TMP_GENESIS" && mv "$TMP_GENESIS" "$GENESIS" diff --git a/sgxvm/src/backend.rs b/sgxvm/src/backend.rs index 5e92950a..aaf28afb 100644 --- a/sgxvm/src/backend.rs +++ b/sgxvm/src/backend.rs @@ -73,9 +73,6 @@ impl<'state> ExtendedBackend for FFIBackend<'state> { storage, .. } => { - // Reset storage is ignored since storage cannot be efficiently reset as this - // would require iterating over storage keys - // Update account balance and nonce let previous_account_data = self.state.get_account(&address); diff --git a/tests/tx-benchmark/.env.example b/tests/tx-benchmark/.env.example index e3a5f61c..8e7a3a06 100644 --- a/tests/tx-benchmark/.env.example +++ b/tests/tx-benchmark/.env.example @@ -1,2 +1,2 @@ NODE_RPC=http://127.0.0.1:8545 -FIRST_PRIVATE_KEY=C516DC17D909EFBB64A0C4A9EE1720E10D47C1BF3590A257D86EEB5FFC644D43 \ No newline at end of file +FIRST_PRIVATE_KEY=DBE7E6AE8303E055B68CEFBF01DEC07E76957FF605E5333FA21B6A8022EA7B55 \ No newline at end of file diff --git a/tests/tx-benchmark/contracts/ERC20Token.json b/tests/tx-benchmark/contracts/ERC20Token.json index 5d2f14b5..22e15460 100644 --- a/tests/tx-benchmark/contracts/ERC20Token.json +++ b/tests/tx-benchmark/contracts/ERC20Token.json @@ -1,27 +1,11 @@ { "_format": "hh-sol-artifact-1", - "contractName": "ERC20Token", - "sourceName": "contracts/ERC20Token.sol", + "contractName": "BenchmarkERC20", + "sourceName": "contracts/BenchmarkERC20.sol", "abi": [ { - "inputs": [ - { - "internalType": "string", - "name": "name", - "type": "string" - }, - { - "internalType": "string", - "name": "symbol", - "type": "string" - }, - { - "internalType": "uint256", - "name": "initialSupply", - "type": "uint256" - } - ], - "stateMutability": "nonpayable", + "inputs": [], + "stateMutability": "payable", "type": "constructor" }, { @@ -141,6 +125,42 @@ "stateMutability": "view", "type": "function" }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "bulkMint", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, + { + "inputs": [ + { + "internalType": "address[]", + "name": "to", + "type": "address[]" + }, + { + "internalType": "uint256[]", + "name": "amounts", + "type": "uint256[]" + } + ], + "name": "bulkTransfer", + "outputs": [], + "stateMutability": "nonpayable", + "type": "function" + }, { "inputs": [], "name": "decimals", @@ -202,24 +222,6 @@ "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", @@ -313,8 +315,8 @@ "type": "function" } ], - "bytecode": "0x60806040523480156200001157600080fd5b5060405162001cd238038062001cd28339818101604052810190620000379190620003bf565b828281600390816200004a91906200069a565b5080600490816200005c91906200069a565b5050506200007133826200007a60201b60201c565b5050506200089c565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603620000ec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401620000e390620007e2565b60405180910390fd5b6200010060008383620001e760201b60201c565b806002600082825462000114919062000833565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051620001c791906200087f565b60405180910390a3620001e360008383620001ec60201b60201c565b5050565b505050565b505050565b6000604051905090565b600080fd5b600080fd5b600080fd5b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6200025a826200020f565b810181811067ffffffffffffffff821117156200027c576200027b62000220565b5b80604052505050565b600062000291620001f1565b90506200029f82826200024f565b919050565b600067ffffffffffffffff821115620002c257620002c162000220565b5b620002cd826200020f565b9050602081019050919050565b60005b83811015620002fa578082015181840152602081019050620002dd565b60008484015250505050565b60006200031d6200031784620002a4565b62000285565b9050828152602081018484840111156200033c576200033b6200020a565b5b62000349848285620002da565b509392505050565b600082601f83011262000369576200036862000205565b5b81516200037b84826020860162000306565b91505092915050565b6000819050919050565b620003998162000384565b8114620003a557600080fd5b50565b600081519050620003b9816200038e565b92915050565b600080600060608486031215620003db57620003da620001fb565b5b600084015167ffffffffffffffff811115620003fc57620003fb62000200565b5b6200040a8682870162000351565b935050602084015167ffffffffffffffff8111156200042e576200042d62000200565b5b6200043c8682870162000351565b92505060406200044f86828701620003a8565b9150509250925092565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680620004ac57607f821691505b602082108103620004c257620004c162000464565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200052c7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82620004ed565b620005388683620004ed565b95508019841693508086168417925050509392505050565b6000819050919050565b60006200057b620005756200056f8462000384565b62000550565b62000384565b9050919050565b6000819050919050565b62000597836200055a565b620005af620005a68262000582565b848454620004fa565b825550505050565b600090565b620005c6620005b7565b620005d38184846200058c565b505050565b5b81811015620005fb57620005ef600082620005bc565b600181019050620005d9565b5050565b601f8211156200064a576200061481620004c8565b6200061f84620004dd565b810160208510156200062f578190505b620006476200063e85620004dd565b830182620005d8565b50505b505050565b600082821c905092915050565b60006200066f600019846008026200064f565b1980831691505092915050565b60006200068a83836200065c565b9150826002028217905092915050565b620006a58262000459565b67ffffffffffffffff811115620006c157620006c062000220565b5b620006cd825462000493565b620006da828285620005ff565b600060209050601f831160018114620007125760008415620006fd578287015190505b6200070985826200067c565b86555062000779565b601f1984166200072286620004c8565b60005b828110156200074c5784890151825560018201915060208501945060208101905062000725565b868310156200076c578489015162000768601f8916826200065c565b8355505b6001600288020188555050505b505050505050565b600082825260208201905092915050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b6000620007ca601f8362000781565b9150620007d78262000792565b602082019050919050565b60006020820190508181036000830152620007fd81620007bb565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000620008408262000384565b91506200084d8362000384565b925082820190508082111562000868576200086762000804565b5b92915050565b620008798162000384565b82525050565b60006020820190506200089660008301846200086e565b92915050565b61142680620008ac6000396000f3fe608060405234801561001057600080fd5b50600436106100b45760003560e01c806340c10f191161007157806340c10f19146101a357806370a08231146101bf57806395d89b41146101ef578063a457c2d71461020d578063a9059cbb1461023d578063dd62ed3e1461026d576100b4565b806306fdde03146100b9578063095ea7b3146100d757806318160ddd1461010757806323b872dd14610125578063313ce567146101555780633950935114610173575b600080fd5b6100c161029d565b6040516100ce9190610c97565b60405180910390f35b6100f160048036038101906100ec9190610d52565b61032f565b6040516100fe9190610dad565b60405180910390f35b61010f610352565b60405161011c9190610dd7565b60405180910390f35b61013f600480360381019061013a9190610df2565b61035c565b60405161014c9190610dad565b60405180910390f35b61015d61038b565b60405161016a9190610e61565b60405180910390f35b61018d60048036038101906101889190610d52565b610394565b60405161019a9190610dad565b60405180910390f35b6101bd60048036038101906101b89190610d52565b6103cb565b005b6101d960048036038101906101d49190610e7c565b6103d9565b6040516101e69190610dd7565b60405180910390f35b6101f7610421565b6040516102049190610c97565b60405180910390f35b61022760048036038101906102229190610d52565b6104b3565b6040516102349190610dad565b60405180910390f35b61025760048036038101906102529190610d52565b61052a565b6040516102649190610dad565b60405180910390f35b61028760048036038101906102829190610ea9565b61054d565b6040516102949190610dd7565b60405180910390f35b6060600380546102ac90610f18565b80601f01602080910402602001604051908101604052809291908181526020018280546102d890610f18565b80156103255780601f106102fa57610100808354040283529160200191610325565b820191906000526020600020905b81548152906001019060200180831161030857829003601f168201915b5050505050905090565b60008061033a6105d4565b90506103478185856105dc565b600191505092915050565b6000600254905090565b6000806103676105d4565b90506103748582856107a5565b61037f858585610831565b60019150509392505050565b60006012905090565b60008061039f6105d4565b90506103c08185856103b1858961054d565b6103bb9190610f78565b6105dc565b600191505092915050565b6103d58282610aa7565b5050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461043090610f18565b80601f016020809104026020016040519081016040528092919081815260200182805461045c90610f18565b80156104a95780601f1061047e576101008083540402835291602001916104a9565b820191906000526020600020905b81548152906001019060200180831161048c57829003601f168201915b5050505050905090565b6000806104be6105d4565b905060006104cc828661054d565b905083811015610511576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105089061101e565b60405180910390fd5b61051e82868684036105dc565b60019250505092915050565b6000806105356105d4565b9050610542818585610831565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361064b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610642906110b0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036106ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b190611142565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107989190610dd7565b60405180910390a3505050565b60006107b1848461054d565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461082b578181101561081d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610814906111ae565b60405180910390fd5b61082a84848484036105dc565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790611240565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361090f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610906906112d2565b60405180910390fd5b61091a838383610bfd565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156109a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099790611364565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a8e9190610dd7565b60405180910390a3610aa1848484610c02565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610b16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0d906113d0565b60405180910390fd5b610b2260008383610bfd565b8060026000828254610b349190610f78565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610be59190610dd7565b60405180910390a3610bf960008383610c02565b5050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610c41578082015181840152602081019050610c26565b60008484015250505050565b6000601f19601f8301169050919050565b6000610c6982610c07565b610c738185610c12565b9350610c83818560208601610c23565b610c8c81610c4d565b840191505092915050565b60006020820190508181036000830152610cb18184610c5e565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610ce982610cbe565b9050919050565b610cf981610cde565b8114610d0457600080fd5b50565b600081359050610d1681610cf0565b92915050565b6000819050919050565b610d2f81610d1c565b8114610d3a57600080fd5b50565b600081359050610d4c81610d26565b92915050565b60008060408385031215610d6957610d68610cb9565b5b6000610d7785828601610d07565b9250506020610d8885828601610d3d565b9150509250929050565b60008115159050919050565b610da781610d92565b82525050565b6000602082019050610dc26000830184610d9e565b92915050565b610dd181610d1c565b82525050565b6000602082019050610dec6000830184610dc8565b92915050565b600080600060608486031215610e0b57610e0a610cb9565b5b6000610e1986828701610d07565b9350506020610e2a86828701610d07565b9250506040610e3b86828701610d3d565b9150509250925092565b600060ff82169050919050565b610e5b81610e45565b82525050565b6000602082019050610e766000830184610e52565b92915050565b600060208284031215610e9257610e91610cb9565b5b6000610ea084828501610d07565b91505092915050565b60008060408385031215610ec057610ebf610cb9565b5b6000610ece85828601610d07565b9250506020610edf85828601610d07565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610f3057607f821691505b602082108103610f4357610f42610ee9565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610f8382610d1c565b9150610f8e83610d1c565b9250828201905080821115610fa657610fa5610f49565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611008602583610c12565b915061101382610fac565b604082019050919050565b6000602082019050818103600083015261103781610ffb565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061109a602483610c12565b91506110a58261103e565b604082019050919050565b600060208201905081810360008301526110c98161108d565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061112c602283610c12565b9150611137826110d0565b604082019050919050565b6000602082019050818103600083015261115b8161111f565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000611198601d83610c12565b91506111a382611162565b602082019050919050565b600060208201905081810360008301526111c78161118b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061122a602583610c12565b9150611235826111ce565b604082019050919050565b600060208201905081810360008301526112598161121d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006112bc602383610c12565b91506112c782611260565b604082019050919050565b600060208201905081810360008301526112eb816112af565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061134e602683610c12565b9150611359826112f2565b604082019050919050565b6000602082019050818103600083015261137d81611341565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b60006113ba601f83610c12565b91506113c582611384565b602082019050919050565b600060208201905081810360008301526113e9816113ad565b905091905056fea26469706673582212201eaf5ff2ad232c399faec9b44680891f6886d44c3720fa28296f75ccfc477af864736f6c63430008110033", - "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100b45760003560e01c806340c10f191161007157806340c10f19146101a357806370a08231146101bf57806395d89b41146101ef578063a457c2d71461020d578063a9059cbb1461023d578063dd62ed3e1461026d576100b4565b806306fdde03146100b9578063095ea7b3146100d757806318160ddd1461010757806323b872dd14610125578063313ce567146101555780633950935114610173575b600080fd5b6100c161029d565b6040516100ce9190610c97565b60405180910390f35b6100f160048036038101906100ec9190610d52565b61032f565b6040516100fe9190610dad565b60405180910390f35b61010f610352565b60405161011c9190610dd7565b60405180910390f35b61013f600480360381019061013a9190610df2565b61035c565b60405161014c9190610dad565b60405180910390f35b61015d61038b565b60405161016a9190610e61565b60405180910390f35b61018d60048036038101906101889190610d52565b610394565b60405161019a9190610dad565b60405180910390f35b6101bd60048036038101906101b89190610d52565b6103cb565b005b6101d960048036038101906101d49190610e7c565b6103d9565b6040516101e69190610dd7565b60405180910390f35b6101f7610421565b6040516102049190610c97565b60405180910390f35b61022760048036038101906102229190610d52565b6104b3565b6040516102349190610dad565b60405180910390f35b61025760048036038101906102529190610d52565b61052a565b6040516102649190610dad565b60405180910390f35b61028760048036038101906102829190610ea9565b61054d565b6040516102949190610dd7565b60405180910390f35b6060600380546102ac90610f18565b80601f01602080910402602001604051908101604052809291908181526020018280546102d890610f18565b80156103255780601f106102fa57610100808354040283529160200191610325565b820191906000526020600020905b81548152906001019060200180831161030857829003601f168201915b5050505050905090565b60008061033a6105d4565b90506103478185856105dc565b600191505092915050565b6000600254905090565b6000806103676105d4565b90506103748582856107a5565b61037f858585610831565b60019150509392505050565b60006012905090565b60008061039f6105d4565b90506103c08185856103b1858961054d565b6103bb9190610f78565b6105dc565b600191505092915050565b6103d58282610aa7565b5050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b60606004805461043090610f18565b80601f016020809104026020016040519081016040528092919081815260200182805461045c90610f18565b80156104a95780601f1061047e576101008083540402835291602001916104a9565b820191906000526020600020905b81548152906001019060200180831161048c57829003601f168201915b5050505050905090565b6000806104be6105d4565b905060006104cc828661054d565b905083811015610511576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016105089061101e565b60405180910390fd5b61051e82868684036105dc565b60019250505092915050565b6000806105356105d4565b9050610542818585610831565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff160361064b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610642906110b0565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036106ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106b190611142565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925836040516107989190610dd7565b60405180910390a3505050565b60006107b1848461054d565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff811461082b578181101561081d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610814906111ae565b60405180910390fd5b61082a84848484036105dc565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036108a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161089790611240565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361090f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610906906112d2565b60405180910390fd5b61091a838383610bfd565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050818110156109a0576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161099790611364565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610a8e9190610dd7565b60405180910390a3610aa1848484610c02565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610b16576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0d906113d0565b60405180910390fd5b610b2260008383610bfd565b8060026000828254610b349190610f78565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610be59190610dd7565b60405180910390a3610bf960008383610c02565b5050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610c41578082015181840152602081019050610c26565b60008484015250505050565b6000601f19601f8301169050919050565b6000610c6982610c07565b610c738185610c12565b9350610c83818560208601610c23565b610c8c81610c4d565b840191505092915050565b60006020820190508181036000830152610cb18184610c5e565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610ce982610cbe565b9050919050565b610cf981610cde565b8114610d0457600080fd5b50565b600081359050610d1681610cf0565b92915050565b6000819050919050565b610d2f81610d1c565b8114610d3a57600080fd5b50565b600081359050610d4c81610d26565b92915050565b60008060408385031215610d6957610d68610cb9565b5b6000610d7785828601610d07565b9250506020610d8885828601610d3d565b9150509250929050565b60008115159050919050565b610da781610d92565b82525050565b6000602082019050610dc26000830184610d9e565b92915050565b610dd181610d1c565b82525050565b6000602082019050610dec6000830184610dc8565b92915050565b600080600060608486031215610e0b57610e0a610cb9565b5b6000610e1986828701610d07565b9350506020610e2a86828701610d07565b9250506040610e3b86828701610d3d565b9150509250925092565b600060ff82169050919050565b610e5b81610e45565b82525050565b6000602082019050610e766000830184610e52565b92915050565b600060208284031215610e9257610e91610cb9565b5b6000610ea084828501610d07565b91505092915050565b60008060408385031215610ec057610ebf610cb9565b5b6000610ece85828601610d07565b9250506020610edf85828601610d07565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b60006002820490506001821680610f3057607f821691505b602082108103610f4357610f42610ee9565b5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000610f8382610d1c565b9150610f8e83610d1c565b9250828201905080821115610fa657610fa5610f49565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b6000611008602583610c12565b915061101382610fac565b604082019050919050565b6000602082019050818103600083015261103781610ffb565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061109a602483610c12565b91506110a58261103e565b604082019050919050565b600060208201905081810360008301526110c98161108d565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061112c602283610c12565b9150611137826110d0565b604082019050919050565b6000602082019050818103600083015261115b8161111f565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b6000611198601d83610c12565b91506111a382611162565b602082019050919050565b600060208201905081810360008301526111c78161118b565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061122a602583610c12565b9150611235826111ce565b604082019050919050565b600060208201905081810360008301526112598161121d565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006112bc602383610c12565b91506112c782611260565b604082019050919050565b600060208201905081810360008301526112eb816112af565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b600061134e602683610c12565b9150611359826112f2565b604082019050919050565b6000602082019050818103600083015261137d81611341565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b60006113ba601f83610c12565b91506113c582611384565b602082019050919050565b600060208201905081810360008301526113e9816113ad565b905091905056fea26469706673582212201eaf5ff2ad232c399faec9b44680891f6886d44c3720fa28296f75ccfc477af864736f6c63430008110033", + "bytecode": "0x60806040526040518060400160405280600781526020017f4d79546f6b656e000000000000000000000000000000000000000000000000008152506040518060400160405280600381526020017f4d544b0000000000000000000000000000000000000000000000000000000000815250816003908162000081919062000316565b50806004908162000093919062000316565b505050620003fd565b600081519050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b600060028204905060018216806200011e57607f821691505b602082108103620001345762000133620000d6565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026200019e7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826200015f565b620001aa86836200015f565b95508019841693508086168417925050509392505050565b6000819050919050565b6000819050919050565b6000620001f7620001f1620001eb84620001c2565b620001cc565b620001c2565b9050919050565b6000819050919050565b6200021383620001d6565b6200022b6200022282620001fe565b8484546200016c565b825550505050565b600090565b6200024262000233565b6200024f81848462000208565b505050565b5b8181101562000277576200026b60008262000238565b60018101905062000255565b5050565b601f821115620002c65762000290816200013a565b6200029b846200014f565b81016020851015620002ab578190505b620002c3620002ba856200014f565b83018262000254565b50505b505050565b600082821c905092915050565b6000620002eb60001984600802620002cb565b1980831691505092915050565b6000620003068383620002d8565b9150826002028217905092915050565b62000321826200009c565b67ffffffffffffffff8111156200033d576200033c620000a7565b5b62000349825462000105565b620003568282856200027b565b600060209050601f8311600181146200038e576000841562000379578287015190505b620003858582620002f8565b865550620003f5565b601f1984166200039e866200013a565b60005b82811015620003c857848901518255600182019150602085019450602081019050620003a1565b86831015620003e85784890151620003e4601f891682620002d8565b8355505b6001600288020188555050505b505050505050565b61194d806200040d6000396000f3fe608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063395093511161008c57806395d89b411161006657806395d89b4114610226578063a457c2d714610244578063a9059cbb14610274578063dd62ed3e146102a4576100cf565b806339509351146101aa5780636ae459bd146101da57806370a08231146101f6576100cf565b806306fdde03146100d4578063095ea7b3146100f2578063153a1f3e1461012257806318160ddd1461013e57806323b872dd1461015c578063313ce5671461018c575b600080fd5b6100dc6102d4565b6040516100e99190610e49565b60405180910390f35b61010c60048036038101906101079190610f13565b610366565b6040516101199190610f6e565b60405180910390f35b61013c60048036038101906101379190611194565b610389565b005b61014661046c565b604051610153919061121b565b60405180910390f35b61017660048036038101906101719190611236565b610476565b6040516101839190610f6e565b60405180910390f35b6101946104a5565b6040516101a191906112a5565b60405180910390f35b6101c460048036038101906101bf9190610f13565b6104ae565b6040516101d19190610f6e565b60405180910390f35b6101f460048036038101906101ef9190611194565b6104e5565b005b610210600480360381019061020b91906112c0565b61058b565b60405161021d919061121b565b60405180910390f35b61022e6105d3565b60405161023b9190610e49565b60405180910390f35b61025e60048036038101906102599190610f13565b610665565b60405161026b9190610f6e565b60405180910390f35b61028e60048036038101906102899190610f13565b6106dc565b60405161029b9190610f6e565b60405180910390f35b6102be60048036038101906102b991906112ed565b6106ff565b6040516102cb919061121b565b60405180910390f35b6060600380546102e39061135c565b80601f016020809104026020016040519081016040528092919081815260200182805461030f9061135c565b801561035c5780601f106103315761010080835404028352916020019161035c565b820191906000526020600020905b81548152906001019060200180831161033f57829003601f168201915b5050505050905090565b600080610371610786565b905061037e81858561078e565b600191505092915050565b80518251146103cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c4906113d9565b60405180910390fd5b60005b8251811015610467578281815181106103ec576103eb6113f9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff166108fc8383815181106104205761041f6113f9565b5b60200260200101519081150290604051600060405180830381858888f19350505050158015610453573d6000803e3d6000fd5b50808061045f90611457565b9150506103d0565b505050565b6000600254905090565b600080610481610786565b905061048e858285610957565b6104998585856109e3565b60019150509392505050565b60006012905090565b6000806104b9610786565b90506104da8185856104cb85896106ff565b6104d5919061149f565b61078e565b600191505092915050565b8051825114610529576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610520906113d9565b60405180910390fd5b60005b82518110156105865761057383828151811061054b5761054a6113f9565b5b6020026020010151838381518110610566576105656113f9565b5b6020026020010151610c59565b808061057e90611457565b91505061052c565b505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546105e29061135c565b80601f016020809104026020016040519081016040528092919081815260200182805461060e9061135c565b801561065b5780601f106106305761010080835404028352916020019161065b565b820191906000526020600020905b81548152906001019060200180831161063e57829003601f168201915b5050505050905090565b600080610670610786565b9050600061067e82866106ff565b9050838110156106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90611545565b60405180910390fd5b6106d0828686840361078e565b60019250505092915050565b6000806106e7610786565b90506106f48185856109e3565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036107fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f4906115d7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390611669565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161094a919061121b565b60405180910390a3505050565b600061096384846106ff565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146109dd57818110156109cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c6906116d5565b60405180910390fd5b6109dc848484840361078e565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610a52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4990611767565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab8906117f9565b60405180910390fd5b610acc838383610daf565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610b52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b499061188b565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c40919061121b565b60405180910390a3610c53848484610db4565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610cc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbf906118f7565b60405180910390fd5b610cd460008383610daf565b8060026000828254610ce6919061149f565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d97919061121b565b60405180910390a3610dab60008383610db4565b5050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610df3578082015181840152602081019050610dd8565b60008484015250505050565b6000601f19601f8301169050919050565b6000610e1b82610db9565b610e258185610dc4565b9350610e35818560208601610dd5565b610e3e81610dff565b840191505092915050565b60006020820190508181036000830152610e638184610e10565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610eaa82610e7f565b9050919050565b610eba81610e9f565b8114610ec557600080fd5b50565b600081359050610ed781610eb1565b92915050565b6000819050919050565b610ef081610edd565b8114610efb57600080fd5b50565b600081359050610f0d81610ee7565b92915050565b60008060408385031215610f2a57610f29610e75565b5b6000610f3885828601610ec8565b9250506020610f4985828601610efe565b9150509250929050565b60008115159050919050565b610f6881610f53565b82525050565b6000602082019050610f836000830184610f5f565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610fc682610dff565b810181811067ffffffffffffffff82111715610fe557610fe4610f8e565b5b80604052505050565b6000610ff8610e6b565b90506110048282610fbd565b919050565b600067ffffffffffffffff82111561102457611023610f8e565b5b602082029050602081019050919050565b600080fd5b600061104d61104884611009565b610fee565b905080838252602082019050602084028301858111156110705761106f611035565b5b835b8181101561109957806110858882610ec8565b845260208401935050602081019050611072565b5050509392505050565b600082601f8301126110b8576110b7610f89565b5b81356110c884826020860161103a565b91505092915050565b600067ffffffffffffffff8211156110ec576110eb610f8e565b5b602082029050602081019050919050565b600061111061110b846110d1565b610fee565b9050808382526020820190506020840283018581111561113357611132611035565b5b835b8181101561115c57806111488882610efe565b845260208401935050602081019050611135565b5050509392505050565b600082601f83011261117b5761117a610f89565b5b813561118b8482602086016110fd565b91505092915050565b600080604083850312156111ab576111aa610e75565b5b600083013567ffffffffffffffff8111156111c9576111c8610e7a565b5b6111d5858286016110a3565b925050602083013567ffffffffffffffff8111156111f6576111f5610e7a565b5b61120285828601611166565b9150509250929050565b61121581610edd565b82525050565b6000602082019050611230600083018461120c565b92915050565b60008060006060848603121561124f5761124e610e75565b5b600061125d86828701610ec8565b935050602061126e86828701610ec8565b925050604061127f86828701610efe565b9150509250925092565b600060ff82169050919050565b61129f81611289565b82525050565b60006020820190506112ba6000830184611296565b92915050565b6000602082840312156112d6576112d5610e75565b5b60006112e484828501610ec8565b91505092915050565b6000806040838503121561130457611303610e75565b5b600061131285828601610ec8565b925050602061132385828601610ec8565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061137457607f821691505b6020821081036113875761138661132d565b5b50919050565b7f746f2e6c656e67746820213d20616d6f756e74732e6c656e6774680000000000600082015250565b60006113c3601b83610dc4565b91506113ce8261138d565b602082019050919050565b600060208201905081810360008301526113f2816113b6565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061146282610edd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361149457611493611428565b5b600182019050919050565b60006114aa82610edd565b91506114b583610edd565b92508282019050808211156114cd576114cc611428565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b600061152f602583610dc4565b915061153a826114d3565b604082019050919050565b6000602082019050818103600083015261155e81611522565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006115c1602483610dc4565b91506115cc82611565565b604082019050919050565b600060208201905081810360008301526115f0816115b4565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611653602283610dc4565b915061165e826115f7565b604082019050919050565b6000602082019050818103600083015261168281611646565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b60006116bf601d83610dc4565b91506116ca82611689565b602082019050919050565b600060208201905081810360008301526116ee816116b2565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611751602583610dc4565b915061175c826116f5565b604082019050919050565b6000602082019050818103600083015261178081611744565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006117e3602383610dc4565b91506117ee82611787565b604082019050919050565b60006020820190508181036000830152611812816117d6565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000611875602683610dc4565b915061188082611819565b604082019050919050565b600060208201905081810360008301526118a481611868565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b60006118e1601f83610dc4565b91506118ec826118ab565b602082019050919050565b60006020820190508181036000830152611910816118d4565b905091905056fea26469706673582212200f42ccb7277a8a963b3cc796b5b87f0bcdc54905fc516637ca8cbd3193195fdc64736f6c63430008110033", + "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100cf5760003560e01c8063395093511161008c57806395d89b411161006657806395d89b4114610226578063a457c2d714610244578063a9059cbb14610274578063dd62ed3e146102a4576100cf565b806339509351146101aa5780636ae459bd146101da57806370a08231146101f6576100cf565b806306fdde03146100d4578063095ea7b3146100f2578063153a1f3e1461012257806318160ddd1461013e57806323b872dd1461015c578063313ce5671461018c575b600080fd5b6100dc6102d4565b6040516100e99190610e49565b60405180910390f35b61010c60048036038101906101079190610f13565b610366565b6040516101199190610f6e565b60405180910390f35b61013c60048036038101906101379190611194565b610389565b005b61014661046c565b604051610153919061121b565b60405180910390f35b61017660048036038101906101719190611236565b610476565b6040516101839190610f6e565b60405180910390f35b6101946104a5565b6040516101a191906112a5565b60405180910390f35b6101c460048036038101906101bf9190610f13565b6104ae565b6040516101d19190610f6e565b60405180910390f35b6101f460048036038101906101ef9190611194565b6104e5565b005b610210600480360381019061020b91906112c0565b61058b565b60405161021d919061121b565b60405180910390f35b61022e6105d3565b60405161023b9190610e49565b60405180910390f35b61025e60048036038101906102599190610f13565b610665565b60405161026b9190610f6e565b60405180910390f35b61028e60048036038101906102899190610f13565b6106dc565b60405161029b9190610f6e565b60405180910390f35b6102be60048036038101906102b991906112ed565b6106ff565b6040516102cb919061121b565b60405180910390f35b6060600380546102e39061135c565b80601f016020809104026020016040519081016040528092919081815260200182805461030f9061135c565b801561035c5780601f106103315761010080835404028352916020019161035c565b820191906000526020600020905b81548152906001019060200180831161033f57829003601f168201915b5050505050905090565b600080610371610786565b905061037e81858561078e565b600191505092915050565b80518251146103cd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103c4906113d9565b60405180910390fd5b60005b8251811015610467578281815181106103ec576103eb6113f9565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff166108fc8383815181106104205761041f6113f9565b5b60200260200101519081150290604051600060405180830381858888f19350505050158015610453573d6000803e3d6000fd5b50808061045f90611457565b9150506103d0565b505050565b6000600254905090565b600080610481610786565b905061048e858285610957565b6104998585856109e3565b60019150509392505050565b60006012905090565b6000806104b9610786565b90506104da8185856104cb85896106ff565b6104d5919061149f565b61078e565b600191505092915050565b8051825114610529576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610520906113d9565b60405180910390fd5b60005b82518110156105865761057383828151811061054b5761054a6113f9565b5b6020026020010151838381518110610566576105656113f9565b5b6020026020010151610c59565b808061057e90611457565b91505061052c565b505050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600480546105e29061135c565b80601f016020809104026020016040519081016040528092919081815260200182805461060e9061135c565b801561065b5780601f106106305761010080835404028352916020019161065b565b820191906000526020600020905b81548152906001019060200180831161063e57829003601f168201915b5050505050905090565b600080610670610786565b9050600061067e82866106ff565b9050838110156106c3576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016106ba90611545565b60405180910390fd5b6106d0828686840361078e565b60019250505092915050565b6000806106e7610786565b90506106f48185856109e3565b600191505092915050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036107fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107f4906115d7565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361086c576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086390611669565b60405180910390fd5b80600160008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9258360405161094a919061121b565b60405180910390a3505050565b600061096384846106ff565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81146109dd57818110156109cf576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109c6906116d5565b60405180910390fd5b6109dc848484840361078e565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610a52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a4990611767565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ac1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ab8906117f9565b60405180910390fd5b610acc838383610daf565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015610b52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b499061188b565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550816000808573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef84604051610c40919061121b565b60405180910390a3610c53848484610db4565b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610cc8576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610cbf906118f7565b60405180910390fd5b610cd460008383610daf565b8060026000828254610ce6919061149f565b92505081905550806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055508173ffffffffffffffffffffffffffffffffffffffff16600073ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051610d97919061121b565b60405180910390a3610dab60008383610db4565b5050565b505050565b505050565b600081519050919050565b600082825260208201905092915050565b60005b83811015610df3578082015181840152602081019050610dd8565b60008484015250505050565b6000601f19601f8301169050919050565b6000610e1b82610db9565b610e258185610dc4565b9350610e35818560208601610dd5565b610e3e81610dff565b840191505092915050565b60006020820190508181036000830152610e638184610e10565b905092915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000610eaa82610e7f565b9050919050565b610eba81610e9f565b8114610ec557600080fd5b50565b600081359050610ed781610eb1565b92915050565b6000819050919050565b610ef081610edd565b8114610efb57600080fd5b50565b600081359050610f0d81610ee7565b92915050565b60008060408385031215610f2a57610f29610e75565b5b6000610f3885828601610ec8565b9250506020610f4985828601610efe565b9150509250929050565b60008115159050919050565b610f6881610f53565b82525050565b6000602082019050610f836000830184610f5f565b92915050565b600080fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b610fc682610dff565b810181811067ffffffffffffffff82111715610fe557610fe4610f8e565b5b80604052505050565b6000610ff8610e6b565b90506110048282610fbd565b919050565b600067ffffffffffffffff82111561102457611023610f8e565b5b602082029050602081019050919050565b600080fd5b600061104d61104884611009565b610fee565b905080838252602082019050602084028301858111156110705761106f611035565b5b835b8181101561109957806110858882610ec8565b845260208401935050602081019050611072565b5050509392505050565b600082601f8301126110b8576110b7610f89565b5b81356110c884826020860161103a565b91505092915050565b600067ffffffffffffffff8211156110ec576110eb610f8e565b5b602082029050602081019050919050565b600061111061110b846110d1565b610fee565b9050808382526020820190506020840283018581111561113357611132611035565b5b835b8181101561115c57806111488882610efe565b845260208401935050602081019050611135565b5050509392505050565b600082601f83011261117b5761117a610f89565b5b813561118b8482602086016110fd565b91505092915050565b600080604083850312156111ab576111aa610e75565b5b600083013567ffffffffffffffff8111156111c9576111c8610e7a565b5b6111d5858286016110a3565b925050602083013567ffffffffffffffff8111156111f6576111f5610e7a565b5b61120285828601611166565b9150509250929050565b61121581610edd565b82525050565b6000602082019050611230600083018461120c565b92915050565b60008060006060848603121561124f5761124e610e75565b5b600061125d86828701610ec8565b935050602061126e86828701610ec8565b925050604061127f86828701610efe565b9150509250925092565b600060ff82169050919050565b61129f81611289565b82525050565b60006020820190506112ba6000830184611296565b92915050565b6000602082840312156112d6576112d5610e75565b5b60006112e484828501610ec8565b91505092915050565b6000806040838503121561130457611303610e75565b5b600061131285828601610ec8565b925050602061132385828601610ec8565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061137457607f821691505b6020821081036113875761138661132d565b5b50919050565b7f746f2e6c656e67746820213d20616d6f756e74732e6c656e6774680000000000600082015250565b60006113c3601b83610dc4565b91506113ce8261138d565b602082019050919050565b600060208201905081810360008301526113f2816113b6565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061146282610edd565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff820361149457611493611428565b5b600182019050919050565b60006114aa82610edd565b91506114b583610edd565b92508282019050808211156114cd576114cc611428565b5b92915050565b7f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760008201527f207a65726f000000000000000000000000000000000000000000000000000000602082015250565b600061152f602583610dc4565b915061153a826114d3565b604082019050919050565b6000602082019050818103600083015261155e81611522565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b60006115c1602483610dc4565b91506115cc82611565565b604082019050919050565b600060208201905081810360008301526115f0816115b4565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b6000611653602283610dc4565b915061165e826115f7565b604082019050919050565b6000602082019050818103600083015261168281611646565b9050919050565b7f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000600082015250565b60006116bf601d83610dc4565b91506116ca82611689565b602082019050919050565b600060208201905081810360008301526116ee816116b2565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b6000611751602583610dc4565b915061175c826116f5565b604082019050919050565b6000602082019050818103600083015261178081611744565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006117e3602383610dc4565b91506117ee82611787565b604082019050919050565b60006020820190508181036000830152611812816117d6565b9050919050565b7f45524332303a207472616e7366657220616d6f756e742065786365656473206260008201527f616c616e63650000000000000000000000000000000000000000000000000000602082015250565b6000611875602683610dc4565b915061188082611819565b604082019050919050565b600060208201905081810360008301526118a481611868565b9050919050565b7f45524332303a206d696e7420746f20746865207a65726f206164647265737300600082015250565b60006118e1601f83610dc4565b91506118ec826118ab565b602082019050919050565b60006020820190508181036000830152611910816118d4565b905091905056fea26469706673582212200f42ccb7277a8a963b3cc796b5b87f0bcdc54905fc516637ca8cbd3193195fdc64736f6c63430008110033", "linkReferences": {}, "deployedLinkReferences": {} } diff --git a/tests/tx-benchmark/index.js b/tests/tx-benchmark/index.js index fa425ae3..c86bdd77 100644 --- a/tests/tx-benchmark/index.js +++ b/tests/tx-benchmark/index.js @@ -6,7 +6,9 @@ const { encryptDataField } = require('@swisstronik/swisstronik.js') const provider = new ethers.providers.JsonRpcProvider(process.env.NODE_RPC || 'http://localhost:8545') const initialWallet = new ethers.Wallet(process.env.FIRST_PRIVATE_KEY, provider) -const NUM_TESTING_ACCOUNTS = 20 +const INIT_WALLET_SWTR_BALANCE = ethers.utils.parseEther("0.01") +const INIT_WALLET_TOKEN_BALANCE = 1000000000 +const NUM_TESTING_ACCOUNTS = 50 async function transferERC20Token(sender, receiverAddress, tokenContract, amountToTransfer) { try { @@ -27,7 +29,8 @@ async function deployERC20() { const metadata = JSON.parse(fs.readFileSync('contracts/ERC20Token.json')) const factory = new ethers.ContractFactory(metadata.abi, metadata.bytecode, initialWallet); - const contract = await factory.deploy('test token', 'TT', 1000000000); + const transferAmount = INIT_WALLET_SWTR_BALANCE.mul(NUM_TESTING_ACCOUNTS); + const contract = await factory.deploy({value: transferAmount}); await contract.deployed() return contract @@ -46,8 +49,8 @@ async function sendShieldedTransaction(signer, destination, data, value) { to: destination, data: encryptedData, value, - gasLimit: 300_000, - gasPrice: 7 // We're using 0 gas price in tests + // gasLimit: 300_000, + // gasPrice: 7 // We're using 0 gas price in tests }) } @@ -68,22 +71,28 @@ async function main() { const tokenContract = await deployERC20() console.log(`ERC20 deployed with address: ${tokenContract.address}`) - // prepare NUM_TESTING_ACCOUNTS accounts and prefund it + console.log('Initializing wallets') const wallets = [] for (let i = 0; i < NUM_TESTING_ACCOUNTS; i++) { const wallet = ethers.Wallet.createRandom().connect(provider) - - const tx = await initialWallet.sendTransaction({ - to: wallet.address, - value: "1000000000" - }) - await tx.wait() - - // Transfer ERC20 token - await transferERC20Token(initialWallet, wallet.address, tokenContract, 10000) - console.log("Wallet", (i + 1), "is ready among", NUM_TESTING_ACCOUNTS, "wallets. Address:", wallet.address) wallets.push(wallet) } + const walletAddresses = wallets.map((wallet) => wallet.address) + const amounts = [...Array(NUM_TESTING_ACCOUNTS)].map(() => INIT_WALLET_SWTR_BALANCE) + const swtrTransferTx = await sendShieldedTransaction( + initialWallet, + tokenContract.address, + tokenContract.interface.encodeFunctionData("bulkTransfer", [walletAddresses, amounts]) + ) + await swtrTransferTx.wait() + + const tokenAmounts = [...Array(NUM_TESTING_ACCOUNTS)].map(() => INIT_WALLET_TOKEN_BALANCE) + const tokenTransferTx = await sendShieldedTransaction( + initialWallet, + tokenContract.address, + tokenContract.interface.encodeFunctionData("bulkMint", [walletAddresses, tokenAmounts]) + ) + await tokenTransferTx.wait() console.log('Wallets are ready') diff --git a/tests/tx-benchmark/package.json b/tests/tx-benchmark/package.json index e8b9c93d..3df39ec3 100644 --- a/tests/tx-benchmark/package.json +++ b/tests/tx-benchmark/package.json @@ -4,7 +4,7 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1" + "start": "node index.js" }, "author": "", "license": "ISC",