Address Contract Partially Verified
Address
0xee42c928F26DfE20C5aE589573B6A715378ECb00
Balance
0 ETH
Nonce
1
Code Size
11601 bytes
Creator
0x9D31d297...B7ba at tx 0xe9652834...0aa669
Indexed Transactions
0
Contract Bytecode
11601 bytes
0x608060405260043610610137575f3560e01c80638f684b65116100aa578063bf4512d31161006e578063bf4512d31461040e578063c2b8b0941461044a578063c57981b514610472578063cbdf382c1461049c578063d547741f146104c6578063e3d4683b146104ee5761013e565b80638f684b651461033857806391d1485414610354578063a217fddf14610390578063a5ece941146103ba578063a771ebc7146103e45761013e565b80633088a5f9116100fc5780633088a5f91461024657806336568abe146102705780633a1a5b7614610298578063485cc955146102c05780635d098b38146102e85780637f34071d146103105761013e565b8062e1d8d01461014257806301ffc9a71461017e5780630db474fa146101ba578063248a9ca3146101e25780632f2ff15d1461021e5761013e565b3661013e57005b5f80fd5b34801561014d575f80fd5b5061016860048036038101906101639190611b6a565b61052a565b6040516101759190611bb7565b60405180910390f35b348015610189575f80fd5b506101a4600480360381019061019f9190611c25565b6105cd565b6040516101b19190611c6a565b60405180910390f35b3480156101c5575f80fd5b506101e060048036038101906101db9190611cad565b610646565b005b3480156101ed575f80fd5b5061020860048036038101906102039190611d0b565b610670565b6040516102159190611d45565b60405180910390f35b348015610229575f80fd5b50610244600480360381019061023f9190611db8565b61068c565b005b348015610251575f80fd5b5061025a6106ae565b6040516102679190611e05565b60405180910390f35b34801561027b575f80fd5b5061029660048036038101906102919190611db8565b6106d3565b005b3480156102a3575f80fd5b506102be60048036038101906102b99190611e7f565b61074e565b005b3480156102cb575f80fd5b506102e660048036038101906102e19190611f03565b610889565b005b3480156102f3575f80fd5b5061030e60048036038101906103099190611f7c565b610a4f565b005b34801561031b575f80fd5b50610336600480360381019061033191906120a6565b610b0d565b005b610352600480360381019061034d9190611b6a565b610c9e565b005b34801561035f575f80fd5b5061037a60048036038101906103759190611db8565b610f5d565b6040516103879190611c6a565b60405180910390f35b34801561039b575f80fd5b506103a4610fc0565b6040516103b19190611d45565b60405180910390f35b3480156103c5575f80fd5b506103ce610fc6565b6040516103db9190611e05565b60405180910390f35b3480156103ef575f80fd5b506103f8610feb565b6040516104059190611c6a565b60405180910390f35b348015610419575f80fd5b50610434600480360381019061042f9190612156565b610ffe565b6040516104419190611e05565b60405180910390f35b348015610455575f80fd5b50610470600480360381019061046b9190612181565b61102e565b005b34801561047d575f80fd5b5061048661108e565b6040516104939190611bb7565b60405180910390f35b3480156104a7575f80fd5b506104b0611093565b6040516104bd9190611e05565b60405180910390f35b3480156104d1575f80fd5b506104ec60048036038101906104e79190611db8565b6110b8565b005b3480156104f9575f80fd5b50610514600480360381019061050f9190612181565b6110da565b6040516105219190611c6a565b60405180910390f35b5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1662e1d8d084846040518363ffffffff1660e01b81526004016105869291906121bf565b602060405180830381865afa1580156105a1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906105c591906121fa565b905092915050565b5f7f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916148061063f575061063e82611104565b5b9050919050565b5f801b6106528161116d565b81600460146101000a81548160ff0219169083151502179055505050565b5f805f8381526020019081526020015f20600101549050919050565b61069582610670565b61069e8161116d565b6106a88383611181565b50505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6106db61126a565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461073f576040517f6697b23200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6107498282611271565b505050565b60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16146107dd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107d4906122a5565b60405180910390fd5b60025f8381526020019081526020015f205f8273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16610875576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161086c9061230d565b60405180910390fd5b610882858585858561135a565b5050505050565b5f6108926115f6565b90505f815f0160089054906101000a900460ff161590505f825f015f9054906101000a900467ffffffffffffffff1690505f808267ffffffffffffffff161480156108da5750825b90505f60018367ffffffffffffffff1614801561090d57505f3073ffffffffffffffffffffffffffffffffffffffff163b145b90508115801561091b575080155b15610952576040517ff92ee8a900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001855f015f6101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905550831561099f576001855f0160086101000a81548160ff0219169083151502179055505b6109ab5f801b88611181565b508560015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508315610a46575f855f0160086101000a81548160ff0219169083151502179055507fc7f505b2f371ae2175ee4913f4499e1f2633a7b5936321eed1cdaeb6115181d26001604051610a3d9190612380565b60405180910390a15b50505050505050565b5f801b610a5b8161116d565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610ac9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ac0906123e3565b60405180910390fd5b8160055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b610b195f801b33610f5d565b610b58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4f90612471565b60405180910390fd5b8383905086869050148015610b7257508181905084849050145b610bb1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ba8906124d9565b60405180910390fd5b5f5b86869050811015610c9557828282818110610bd157610bd06124f7565b5b9050602002016020810190610be69190611cad565b60025f898985818110610bfc57610bfb6124f7565b5b9050602002013581526020019081526020015f205f878785818110610c2457610c236124f7565b5b9050602002016020810190610c399190612524565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055508080600101915050610bb3565b50505050505050565b610ca661161d565b5f73ffffffffffffffffffffffffffffffffffffffff1660065f8481526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1603610d44576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3b90612599565b60405180910390fd5b610d9233308360045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1661166c909392919063ffffffff16565b5f610d9c826116ee565b9050600460149054906101000a900460ff1615610e3657610dc6818361171e90919063ffffffff16565b9150610e3560055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff168260045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117339092919063ffffffff16565b5b5f610e4484620c350061052a565b905080341015610e89576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8090612601565b60405180910390fd5b610ee88460065f8781526020019081526020015f205f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16333387604051602001610ed393929190612669565b604051602081830303815290604052846117b2565b503373ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff16857f1a57b6e187335684e3c8cb69608a4155049f5fbedb5af9e8c4afba983dcd14bd86604051610f479190611bb7565b60405180910390a45050610f5961185d565b5050565b5f805f8481526020019081526020015f205f015f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff16905092915050565b5f801b81565b60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600460149054906101000a900460ff1681565b6006602052805f5260405f205f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f801b61103a8161116d565b8160065f8581526020019081526020015f205f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff160217905550505050565b603281565b60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6110c182610670565b6110ca8161116d565b6110d48383611271565b50505050565b6002602052815f5260405f20602052805f5260405f205f915091509054906101000a900460ff1681565b5f7f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b61117e8161117961126a565b611867565b50565b5f61118c8383610f5d565b6112605760015f808581526020019081526020015f205f015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506111fd61126a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a460019050611264565b5f90505b92915050565b5f33905090565b5f61127c8383610f5d565b15611350575f805f8581526020019081526020015f205f015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506112ed61126a565b73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16847ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a460019050611354565b5f90505b92915050565b5f805f80888881019061136d91906127e9565b93509350935093508160045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016113d09190611e05565b602060405180830381865afa1580156113eb573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061140f91906121fa565b106114cd57611460838360045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166117339092919063ffffffff16565b8273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16877f562d19e64f1e6d0b1cc1ff383f9fbc0162d055202278d2c7dcc258b25cb700b785856040516114c09291906128d3565b60405180910390a46115eb565b7f8dc8cb22bfc1eeba340c0c09f7a1b7041c2a96a4c3a89cb2d47ecc671471db8d8180519060200120036115a7575f6115098762061a8061052a565b905061153a87878688876040516020016115259392919061294b565b604051602081830303815290604052846117b2565b508373ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16887f71bf04511eb7e8368da280a96ce20f45bb43fda962d1b0c39f90a08b5e2ef489866040516115999190611bb7565b60405180910390a4506115ea565b838383886040517f544e6f4f0000000000000000000000000000000000000000000000000000000081526004016115e19493929190612993565b60405180910390fd5b5b505050505050505050565b5f7ff0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00905090565b600260035403611662576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165990612a20565b60405180910390fd5b6002600381905550565b6116e8848573ffffffffffffffffffffffffffffffffffffffff166323b872dd8686866040516024016116a193929190612a3e565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118b8565b50505050565b5f61171761271061170960328561194d90919063ffffffff16565b61196290919063ffffffff16565b9050919050565b5f818361172b9190612aa0565b905092915050565b6117ad838473ffffffffffffffffffffffffffffffffffffffff1663a9059cbb8585604051602401611766929190612ad3565b604051602081830303815290604052915060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506118b8565b505050565b5f60015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663fe39827b838787876040518563ffffffff1660e01b815260040161181293929190612b4c565b60206040518083038185885af115801561182e573d5f803e3d5ffd5b50505050506040513d601f19601f820116820180604052508101906118539190612b9c565b9050949350505050565b6001600381905550565b6118718282610f5d565b6118b45780826040517fe2517d3f0000000000000000000000000000000000000000000000000000000081526004016118ab929190612bc7565b60405180910390fd5b5050565b5f6118e2828473ffffffffffffffffffffffffffffffffffffffff1661197790919063ffffffff16565b90505f8151141580156119065750808060200190518101906119049190612c02565b155b1561194857826040517f5274afe700000000000000000000000000000000000000000000000000000000815260040161193f9190611e05565b60405180910390fd5b505050565b5f818361195a9190612c2d565b905092915050565b5f818361196f9190612c9b565b905092915050565b606061198483835f61198c565b905092915050565b6060814710156119d357306040517fcd7860590000000000000000000000000000000000000000000000000000000081526004016119ca9190611e05565b60405180910390fd5b5f808573ffffffffffffffffffffffffffffffffffffffff1684866040516119fb9190612d05565b5f6040518083038185875af1925050503d805f8114611a35576040519150601f19603f3d011682016040523d82523d5f602084013e611a3a565b606091505b5091509150611a4a868383611a55565b925050509392505050565b606082611a6a57611a6582611ae2565b611ada565b5f8251148015611a9057505f8473ffffffffffffffffffffffffffffffffffffffff163b145b15611ad257836040517f9996b315000000000000000000000000000000000000000000000000000000008152600401611ac99190611e05565b60405180910390fd5b819050611adb565b5b9392505050565b5f81511115611af45780518082602001fd5b6040517f1425ea4200000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b5f604051905090565b5f80fd5b5f80fd5b5f819050919050565b611b4981611b37565b8114611b53575f80fd5b50565b5f81359050611b6481611b40565b92915050565b5f8060408385031215611b8057611b7f611b2f565b5b5f611b8d85828601611b56565b9250506020611b9e85828601611b56565b9150509250929050565b611bb181611b37565b82525050565b5f602082019050611bca5f830184611ba8565b92915050565b5f7fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b611c0481611bd0565b8114611c0e575f80fd5b50565b5f81359050611c1f81611bfb565b92915050565b5f60208284031215611c3a57611c39611b2f565b5b5f611c4784828501611c11565b91505092915050565b5f8115159050919050565b611c6481611c50565b82525050565b5f602082019050611c7d5f830184611c5b565b92915050565b611c8c81611c50565b8114611c96575f80fd5b50565b5f81359050611ca781611c83565b92915050565b5f60208284031215611cc257611cc1611b2f565b5b5f611ccf84828501611c99565b91505092915050565b5f819050919050565b611cea81611cd8565b8114611cf4575f80fd5b50565b5f81359050611d0581611ce1565b92915050565b5f60208284031215611d2057611d1f611b2f565b5b5f611d2d84828501611cf7565b91505092915050565b611d3f81611cd8565b82525050565b5f602082019050611d585f830184611d36565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f611d8782611d5e565b9050919050565b611d9781611d7d565b8114611da1575f80fd5b50565b5f81359050611db281611d8e565b92915050565b5f8060408385031215611dce57611dcd611b2f565b5b5f611ddb85828601611cf7565b9250506020611dec85828601611da4565b9150509250929050565b611dff81611d7d565b82525050565b5f602082019050611e185f830184611df6565b92915050565b5f80fd5b5f80fd5b5f80fd5b5f8083601f840112611e3f57611e3e611e1e565b5b8235905067ffffffffffffffff811115611e5c57611e5b611e22565b5b602083019150836001820283011115611e7857611e77611e26565b5b9250929050565b5f805f805f60808688031215611e9857611e97611b2f565b5b5f86013567ffffffffffffffff811115611eb557611eb4611b33565b5b611ec188828901611e2a565b95509550506020611ed488828901611cf7565b9350506040611ee588828901611b56565b9250506060611ef688828901611da4565b9150509295509295909350565b5f8060408385031215611f1957611f18611b2f565b5b5f611f2685828601611da4565b9250506020611f3785828601611da4565b9150509250929050565b5f611f4b82611d5e565b9050919050565b611f5b81611f41565b8114611f65575f80fd5b50565b5f81359050611f7681611f52565b92915050565b5f60208284031215611f9157611f90611b2f565b5b5f611f9e84828501611f68565b91505092915050565b5f8083601f840112611fbc57611fbb611e1e565b5b8235905067ffffffffffffffff811115611fd957611fd8611e22565b5b602083019150836020820283011115611ff557611ff4611e26565b5b9250929050565b5f8083601f84011261201157612010611e1e565b5b8235905067ffffffffffffffff81111561202e5761202d611e22565b5b60208301915083602082028301111561204a57612049611e26565b5b9250929050565b5f8083601f84011261206657612065611e1e565b5b8235905067ffffffffffffffff81111561208357612082611e22565b5b60208301915083602082028301111561209f5761209e611e26565b5b9250929050565b5f805f805f80606087890312156120c0576120bf611b2f565b5b5f87013567ffffffffffffffff8111156120dd576120dc611b33565b5b6120e989828a01611fa7565b9650965050602087013567ffffffffffffffff81111561210c5761210b611b33565b5b61211889828a01611ffc565b9450945050604087013567ffffffffffffffff81111561213b5761213a611b33565b5b61214789828a01612051565b92509250509295509295509295565b5f6020828403121561216b5761216a611b2f565b5b5f61217884828501611b56565b91505092915050565b5f806040838503121561219757612196611b2f565b5b5f6121a485828601611b56565b92505060206121b585828601611da4565b9150509250929050565b5f6040820190506121d25f830185611ba8565b6121df6020830184611ba8565b9392505050565b5f815190506121f481611b40565b92915050565b5f6020828403121561220f5761220e611b2f565b5b5f61221c848285016121e6565b91505092915050565b5f82825260208201905092915050565b7f576d624170703a204f6e6c7920574d4220676174657761792063616e2063616c5f8201527f6c20746869732066756e6374696f6e0000000000000000000000000000000000602082015250565b5f61228f602f83612225565b915061229a82612235565b604082019050919050565b5f6020820190508181035f8301526122bc81612283565b9050919050565b7f576d624170703a2052656d6f7465206973206e6f7420747275737465640000005f82015250565b5f6122f7601d83612225565b9150612302826122c3565b602082019050919050565b5f6020820190508181035f830152612324816122eb565b9050919050565b5f819050919050565b5f67ffffffffffffffff82169050919050565b5f819050919050565b5f61236a6123656123608461232b565b612347565b612334565b9050919050565b61237a81612350565b82525050565b5f6020820190506123935f830184612371565b92915050565b7f4d61726b6574696e672077616c6c6574206973207a65726f00000000000000005f82015250565b5f6123cd601883612225565b91506123d882612399565b602082019050919050565b5f6020820190508181035f8301526123fa816123c1565b9050919050565b7f576d624170703a206d75737420686176652061646d696e20726f6c6520746f205f8201527f73657420747275737465642072656d6f74657300000000000000000000000000602082015250565b5f61245b603383612225565b915061246682612401565b604082019050919050565b5f6020820190508181035f8301526124888161244f565b9050919050565b7f576d624170703a20696e76616c696420696e70757400000000000000000000005f82015250565b5f6124c3601583612225565b91506124ce8261248f565b602082019050919050565b5f6020820190508181035f8301526124f0816124b7565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f6020828403121561253957612538611b2f565b5b5f61254684828501611da4565b91505092915050565b7f72656d6f746520706f6f6c206e6f7420636f6e666967757265640000000000005f82015250565b5f612583601a83612225565b915061258e8261254f565b602082019050919050565b5f6020820190508181035f8301526125b081612577565b9050919050565b7f496e73756666696369656e7420666565000000000000000000000000000000005f82015250565b5f6125eb601083612225565b91506125f6826125b7565b602082019050919050565b5f6020820190508181035f830152612618816125df565b9050919050565b7f63726f7373546f000000000000000000000000000000000000000000000000005f82015250565b5f612653600783612225565b915061265e8261261f565b602082019050919050565b5f60808201905061267c5f830186611df6565b6126896020830185611df6565b6126966040830184611ba8565b81810360608301526126a781612647565b9050949350505050565b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6126fb826126b5565b810181811067ffffffffffffffff8211171561271a576127196126c5565b5b80604052505050565b5f61272c611b26565b905061273882826126f2565b919050565b5f67ffffffffffffffff821115612757576127566126c5565b5b612760826126b5565b9050602081019050919050565b828183375f83830152505050565b5f61278d6127888461273d565b612723565b9050828152602081018484840111156127a9576127a86126b1565b5b6127b484828561276d565b509392505050565b5f82601f8301126127d0576127cf611e1e565b5b81356127e084826020860161277b565b91505092915050565b5f805f806080858703121561280157612800611b2f565b5b5f61280e87828801611f68565b945050602061281f87828801611f68565b935050604061283087828801611b56565b925050606085013567ffffffffffffffff81111561285157612850611b33565b5b61285d878288016127bc565b91505092959194509250565b5f81519050919050565b5f5b83811015612890578082015181840152602081019050612875565b5f8484015250505050565b5f6128a582612869565b6128af8185612225565b93506128bf818560208601612873565b6128c8816126b5565b840191505092915050565b5f6040820190506128e65f830185611ba8565b81810360208301526128f8818461289b565b90509392505050565b7f63726f73735265766572740000000000000000000000000000000000000000005f82015250565b5f612935600b83612225565b915061294082612901565b602082019050919050565b5f60808201905061295e5f830186611df6565b61296b6020830185611df6565b6129786040830184611ba8565b818103606083015261298981612929565b9050949350505050565b5f6080820190506129a65f830187611df6565b6129b36020830186611df6565b6129c06040830185611ba8565b6129cd6060830184611ba8565b95945050505050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c005f82015250565b5f612a0a601f83612225565b9150612a15826129d6565b602082019050919050565b5f6020820190508181035f830152612a37816129fe565b9050919050565b5f606082019050612a515f830186611df6565b612a5e6020830185611df6565b612a6b6040830184611ba8565b949350505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f612aaa82611b37565b9150612ab583611b37565b9250828203905081811115612acd57612acc612a73565b5b92915050565b5f604082019050612ae65f830185611df6565b612af36020830184611ba8565b9392505050565b5f81519050919050565b5f82825260208201905092915050565b5f612b1e82612afa565b612b288185612b04565b9350612b38818560208601612873565b612b41816126b5565b840191505092915050565b5f606082019050612b5f5f830186611ba8565b612b6c6020830185611df6565b8181036040830152612b7e8184612b14565b9050949350505050565b5f81519050612b9681611ce1565b92915050565b5f60208284031215612bb157612bb0611b2f565b5b5f612bbe84828501612b88565b91505092915050565b5f604082019050612bda5f830185611df6565b612be76020830184611d36565b9392505050565b5f81519050612bfc81611c83565b92915050565b5f60208284031215612c1757612c16611b2f565b5b5f612c2484828501612bee565b91505092915050565b5f612c3782611b37565b9150612c4283611b37565b9250828202612c5081611b37565b91508282048414831517612c6757612c66612a73565b5b5092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612ca582611b37565b9150612cb083611b37565b925082612cc057612cbf612c6e565b5b828204905092915050565b5f81905092915050565b5f612cdf82612afa565b612ce98185612ccb565b9350612cf9818560208601612873565b80840191505092915050565b5f612d108284612cd5565b91508190509291505056fea26469706673582212208c3dff4c30e8ceec9e1896a835c40f00c09934356a9d50c11f827f7f97550dd364736f6c63430008160033
Verified Source Code Partial Match
Compiler: v0.8.22+commit.4fc1097e
EVM: shanghai
Optimization: No
CCPool.sol 1828 lines
// SPDX-License-Identifier: MIT
// File: contracts/Final/interfaces/IWmbReceiver.sol
pragma solidity ^0.8.0;
/**
* @title IWmbReceiver
* @dev Interface for contracts that can receive messages from the Wanchain Message Bridge (WMB).
*/
interface IWmbReceiver {
/**
* @dev Handles a message received from the WMB network
* @param data The data contained within the message
* @param messageId The unique identifier of the message
* @param fromChainId The ID of the chain that sent the message
* @param from The address of the contract that sent the message
*
* This interface follows the EIP-5164 standard.
*/
function wmbReceive(
bytes calldata data,
bytes32 messageId,
uint256 fromChainId,
address from
) external;
}
// File: contracts/Final/interfaces/IEIP5164.sol
pragma solidity ^0.8.0;
// EIP-5164 defines a cross-chain execution interface for EVM-based blockchains.
// Implementations of this specification will allow contracts on one chain to call contracts on another by sending a cross-chain message.
// https://github.com/ethereum/EIPs/blob/master/EIPS/eip-5164.md
struct Message {
address to;
bytes data;
}
interface MessageDispatcher {
event MessageDispatched(
bytes32 indexed messageId,
address indexed from,
uint256 indexed toChainId,
address to,
bytes data
);
event MessageBatchDispatched(
bytes32 indexed messageId,
address indexed from,
uint256 indexed toChainId,
Message[] messages
);
}
interface SingleMessageDispatcher is MessageDispatcher {
/**
* @notice Sends a message to a specified chain and address with the given data.
* @dev This function is used to dispatch a message to a specified chain and address with the given data.
* @param toChainId The chain ID of the destination chain.
* @param to The address of the destination contract on the destination chain.
* @param data The data to be sent to the destination contract.
* @return messageId A unique identifier for the dispatched message.
*/
function dispatchMessage(uint256 toChainId, address to, bytes calldata data) external payable returns (bytes32 messageId);
}
interface BatchedMessageDispatcher is MessageDispatcher {
/**
* @notice Sends a batch of messages to a specified chain.
* @dev This function is used to dispatch a batch of messages to a specified chain and returns a unique identifier for the dispatched batch.
* @param toChainId The chain ID of the destination chain.
* @param messages An array of Message struct objects containing the destination addresses and data to be sent to each destination contract.
* @return messageId A unique identifier for the dispatched batch.
*/
function dispatchMessageBatch(uint256 toChainId, Message[] calldata messages) external payable returns (bytes32 messageId);
}
/**
* MessageExecutor
*
* MessageExecutors MUST append the ABI-packed (messageId, fromChainId, from) to the calldata for each message being executed.
*
* to: The address of the contract to call.
* data: The data to cross-chain.
* messageId: The unique identifier of the message being executed.
* fromChainId: The ID of the chain the message originated from.
* from: The address of the sender of the message.
* to.call(abi.encodePacked(data, messageId, fromChainId, from));
*/
interface MessageExecutor {
error MessageIdAlreadyExecuted(
bytes32 messageId
);
error MessageFailure(
bytes32 messageId,
bytes errorData
);
error MessageBatchFailure(
bytes32 messageId,
uint256 messageIndex,
bytes errorData
);
event MessageIdExecuted(
uint256 indexed fromChainId,
bytes32 indexed messageId
);
}
interface IEIP5164 is SingleMessageDispatcher, BatchedMessageDispatcher, MessageExecutor {}
// File: contracts/Final/interfaces/IWmbGateway.sol
pragma solidity ^0.8.0;
/**
* @title IWmbGateway
* @dev Interface for the Wanchain Message Bridge Gateway contract
* @dev This interface is used to send and receive messages between chains
* @dev This interface is based on EIP-5164
* @dev It extends the EIP-5164 interface, adding a custom gasLimit feature.
*/
interface IWmbGateway is IEIP5164 {
/**
* @dev Estimates the fee required to send a message to a target chain
* @param targetChainId ID of the target chain
* @param gasLimit Total Gas limit for the message call
* @return fee The estimated fee for the message call
*/
function estimateFee(
uint256 targetChainId,
uint256 gasLimit
) external view returns (uint256 fee);
/**
* @dev Receives a message sent from another chain and verifies the signature of the sender.
* @param messageId Unique identifier of the message to prevent replay attacks
* @param sourceChainId ID of the source chain
* @param sourceContract Address of the source contract
* @param targetContract Address of the target contract
* @param messageData Data sent in the message
* @param gasLimit Gas limit for the message call
* @param smgID ID of the Wanchain Storeman Group that signs the message
* @param r R component of the SMG MPC signature
* @param s S component of the SMG MPC signature
*
* This function receives a message sent from another chain and verifies the signature of the sender using the provided SMG ID and signature components (r and s).
* If the signature is verified successfully, the message is executed on the target contract.
* The nonce value is used to prevent replay attacks.
* The gas limit is used to limit the amount of gas that can be used for the message execution.
*/
function receiveMessage(
bytes32 messageId,
uint256 sourceChainId,
address sourceContract,
address targetContract,
bytes calldata messageData,
uint256 gasLimit,
bytes32 smgID,
bytes calldata r,
bytes32 s
) external;
/**
* @dev Receives a message sent from another chain and verifies the signature of the sender.
* @param messageId Unique identifier of the message to prevent replay attacks
* @param sourceChainId ID of the source chain
* @param sourceContract Address of the source contract
* @param messages Data sent in the message
* @param gasLimit Gas limit for the message call
* @param smgID ID of the Wanchain Storeman Group that signs the message
* @param r R component of the SMG MPC signature
* @param s S component of the SMG MPC signature
*
* This function receives a message sent from another chain and verifies the signature of the sender using the provided SMG ID and signature components (r and s).
* If the signature is verified successfully, the message is executed on the target contract.
* The nonce value is used to prevent replay attacks.
* The gas limit is used to limit the amount of gas that can be used for the message execution.
*/
function receiveBatchMessage(
bytes32 messageId,
uint256 sourceChainId,
address sourceContract,
Message[] calldata messages,
uint256 gasLimit,
bytes32 smgID,
bytes calldata r,
bytes32 s
) external;
error SignatureVerifyFailed(
bytes32 smgID,
bytes32 sigHash,
bytes r,
bytes32 s
);
error StoremanGroupNotReady(
bytes32 smgID,
uint256 status,
uint256 timestamp,
uint256 startTime,
uint256 endTime
);
}
// File: @openzeppelin/contracts/proxy/utils/Initializable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (proxy/utils/Initializable.sol)
pragma solidity ^0.8.20;
/**
* @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
* behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
* external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
* function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
*
* The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
* reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
* case an upgrade adds a module that needs to be initialized.
*
* For example:
*
* [.hljs-theme-light.nopadding]
* ```solidity
* contract MyToken is ERC20Upgradeable {
* function initialize() initializer public {
* __ERC20_init("MyToken", "MTK");
* }
* }
*
* contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
* function initializeV2() reinitializer(2) public {
* __ERC20Permit_init("MyToken");
* }
* }
* ```
*
* TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
* possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
*
* CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
* that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
*
* [CAUTION]
* ====
* Avoid leaving a contract uninitialized.
*
* An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
* contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
* the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
*
* [.hljs-theme-light.nopadding]
* ```
* /// @custom:oz-upgrades-unsafe-allow constructor
* constructor() {
* _disableInitializers();
* }
* ```
* ====
*/
abstract contract Initializable {
/**
* @dev Storage of the initializable contract.
*
* It's implemented on a custom ERC-7201 namespace to reduce the risk of storage collisions
* when using with upgradeable contracts.
*
* @custom:storage-location erc7201:openzeppelin.storage.Initializable
*/
struct InitializableStorage {
/**
* @dev Indicates that the contract has been initialized.
*/
uint64 _initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool _initializing;
}
// keccak256(abi.encode(uint256(keccak256("openzeppelin.storage.Initializable")) - 1)) & ~bytes32(uint256(0xff))
bytes32 private constant INITIALIZABLE_STORAGE = 0xf0c57e16840df040f15088dc2f81fe391c3923bec73e23a9662efc9c229c6a00;
/**
* @dev The contract is already initialized.
*/
error InvalidInitialization();
/**
* @dev The contract is not initializing.
*/
error NotInitializing();
/**
* @dev Triggered when the contract has been initialized or reinitialized.
*/
event Initialized(uint64 version);
/**
* @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
* `onlyInitializing` functions can be used to initialize parent contracts.
*
* Similar to `reinitializer(1)`, except that in the context of a constructor an `initializer` may be invoked any
* number of times. This behavior in the constructor can be useful during testing and is not expected to be used in
* production.
*
* Emits an {Initialized} event.
*/
modifier initializer() {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
// Cache values to avoid duplicated sloads
bool isTopLevelCall = !$._initializing;
uint64 initialized = $._initialized;
// Allowed calls:
// - initialSetup: the contract is not in the initializing state and no previous version was
// initialized
// - construction: the contract is initialized at version 1 (no reininitialization) and the
// current contract is just being deployed
bool initialSetup = initialized == 0 && isTopLevelCall;
bool construction = initialized == 1 && address(this).code.length == 0;
if (!initialSetup && !construction) {
revert InvalidInitialization();
}
$._initialized = 1;
if (isTopLevelCall) {
$._initializing = true;
}
_;
if (isTopLevelCall) {
$._initializing = false;
emit Initialized(1);
}
}
/**
* @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
* contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
* used to initialize parent contracts.
*
* A reinitializer may be used after the original initialization step. This is essential to configure modules that
* are added through upgrades and that require initialization.
*
* When `version` is 1, this modifier is similar to `initializer`, except that functions marked with `reinitializer`
* cannot be nested. If one is invoked in the context of another, execution will revert.
*
* Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
* a contract, executing them in the right order is up to the developer or operator.
*
* WARNING: Setting the version to 2**64 - 1 will prevent any future reinitialization.
*
* Emits an {Initialized} event.
*/
modifier reinitializer(uint64 version) {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing || $._initialized >= version) {
revert InvalidInitialization();
}
$._initialized = version;
$._initializing = true;
_;
$._initializing = false;
emit Initialized(version);
}
/**
* @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
* {initializer} and {reinitializer} modifiers, directly or indirectly.
*/
modifier onlyInitializing() {
_checkInitializing();
_;
}
/**
* @dev Reverts if the contract is not in an initializing state. See {onlyInitializing}.
*/
function _checkInitializing() internal view virtual {
if (!_isInitializing()) {
revert NotInitializing();
}
}
/**
* @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
* Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
* to any version. It is recommended to use this to lock implementation contracts that are designed to be called
* through proxies.
*
* Emits an {Initialized} event the first time it is successfully executed.
*/
function _disableInitializers() internal virtual {
// solhint-disable-next-line var-name-mixedcase
InitializableStorage storage $ = _getInitializableStorage();
if ($._initializing) {
revert InvalidInitialization();
}
if ($._initialized != type(uint64).max) {
$._initialized = type(uint64).max;
emit Initialized(type(uint64).max);
}
}
/**
* @dev Returns the highest version that has been initialized. See {reinitializer}.
*/
function _getInitializedVersion() internal view returns (uint64) {
return _getInitializableStorage()._initialized;
}
/**
* @dev Returns `true` if the contract is currently initializing. See {onlyInitializing}.
*/
function _isInitializing() internal view returns (bool) {
return _getInitializableStorage()._initializing;
}
/**
* @dev Returns a pointer to the storage namespace.
*/
// solhint-disable-next-line var-name-mixedcase
function _getInitializableStorage() private pure returns (InitializableStorage storage $) {
assembly {
$.slot := INITIALIZABLE_STORAGE
}
}
}
// File: @openzeppelin/contracts/utils/introspection/IERC165.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// File: @openzeppelin/contracts/utils/introspection/ERC165.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)
pragma solidity ^0.8.20;
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/access/IAccessControl.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)
pragma solidity ^0.8.20;
/**
* @dev External interface of AccessControl declared to support ERC165 detection.
*/
interface IAccessControl {
/**
* @dev The `account` is missing a role.
*/
error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);
/**
* @dev The caller of a function is not the expected one.
*
* NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
*/
error AccessControlBadConfirmation();
/**
* @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
*
* `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
* {RoleAdminChanged} not being emitted signaling this.
*/
event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);
/**
* @dev Emitted when `account` is granted `role`.
*
* `sender` is the account that originated the contract call, an admin role
* bearer except when using {AccessControl-_setupRole}.
*/
event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Emitted when `account` is revoked `role`.
*
* `sender` is the account that originated the contract call:
* - if using `revokeRole`, it is the admin role bearer
* - if using `renounceRole`, it is the role bearer (i.e. `account`)
*/
event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) external view returns (bool);
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {AccessControl-_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) external view returns (bytes32);
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function grantRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*/
function revokeRole(bytes32 role, address account) external;
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been granted `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*/
function renounceRole(bytes32 role, address callerConfirmation) external;
}
// File: @openzeppelin/contracts/access/AccessControl.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)
pragma solidity ^0.8.20;
/**
* @dev Contract module that allows children to implement role-based access
* control mechanisms. This is a lightweight version that doesn't allow enumerating role
* members except through off-chain means by accessing the contract event logs. Some
* applications may benefit from on-chain enumerability, for those cases see
* {AccessControlEnumerable}.
*
* Roles are referred to by their `bytes32` identifier. These should be exposed
* in the external API and be unique. The best way to achieve this is by
* using `public constant` hash digests:
*
* ```solidity
* bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
* ```
*
* Roles can be used to represent a set of permissions. To restrict access to a
* function call, use {hasRole}:
*
* ```solidity
* function foo() public {
* require(hasRole(MY_ROLE, msg.sender));
* ...
* }
* ```
*
* Roles can be granted and revoked dynamically via the {grantRole} and
* {revokeRole} functions. Each role has an associated admin role, and only
* accounts that have a role's admin role can call {grantRole} and {revokeRole}.
*
* By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
* that only accounts with this role will be able to grant or revoke other
* roles. More complex role relationships can be created by using
* {_setRoleAdmin}.
*
* WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
* grant and revoke this role. Extra precautions should be taken to secure
* accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
* to enforce additional security measures for this role.
*/
abstract contract AccessControl is Context, IAccessControl, ERC165 {
struct RoleData {
mapping(address account => bool) hasRole;
bytes32 adminRole;
}
mapping(bytes32 role => RoleData) private _roles;
bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;
/**
* @dev Modifier that checks that an account has a specific role. Reverts
* with an {AccessControlUnauthorizedAccount} error including the required role.
*/
modifier onlyRole(bytes32 role) {
_checkRole(role);
_;
}
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
}
/**
* @dev Returns `true` if `account` has been granted `role`.
*/
function hasRole(bytes32 role, address account) public view virtual returns (bool) {
return _roles[role].hasRole[account];
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
* is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
*/
function _checkRole(bytes32 role) internal view virtual {
_checkRole(role, _msgSender());
}
/**
* @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
* is missing `role`.
*/
function _checkRole(bytes32 role, address account) internal view virtual {
if (!hasRole(role, account)) {
revert AccessControlUnauthorizedAccount(account, role);
}
}
/**
* @dev Returns the admin role that controls `role`. See {grantRole} and
* {revokeRole}.
*
* To change a role's admin, use {_setRoleAdmin}.
*/
function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
return _roles[role].adminRole;
}
/**
* @dev Grants `role` to `account`.
*
* If `account` had not been already granted `role`, emits a {RoleGranted}
* event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleGranted} event.
*/
function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_grantRole(role, account);
}
/**
* @dev Revokes `role` from `account`.
*
* If `account` had been granted `role`, emits a {RoleRevoked} event.
*
* Requirements:
*
* - the caller must have ``role``'s admin role.
*
* May emit a {RoleRevoked} event.
*/
function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
_revokeRole(role, account);
}
/**
* @dev Revokes `role` from the calling account.
*
* Roles are often managed via {grantRole} and {revokeRole}: this function's
* purpose is to provide a mechanism for accounts to lose their privileges
* if they are compromised (such as when a trusted device is misplaced).
*
* If the calling account had been revoked `role`, emits a {RoleRevoked}
* event.
*
* Requirements:
*
* - the caller must be `callerConfirmation`.
*
* May emit a {RoleRevoked} event.
*/
function renounceRole(bytes32 role, address callerConfirmation) public virtual {
if (callerConfirmation != _msgSender()) {
revert AccessControlBadConfirmation();
}
_revokeRole(role, callerConfirmation);
}
/**
* @dev Sets `adminRole` as ``role``'s admin role.
*
* Emits a {RoleAdminChanged} event.
*/
function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
bytes32 previousAdminRole = getRoleAdmin(role);
_roles[role].adminRole = adminRole;
emit RoleAdminChanged(role, previousAdminRole, adminRole);
}
/**
* @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
*
* Internal function without access restriction.
*
* May emit a {RoleGranted} event.
*/
function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
if (!hasRole(role, account)) {
_roles[role].hasRole[account] = true;
emit RoleGranted(role, account, _msgSender());
return true;
} else {
return false;
}
}
/**
* @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
*
* Internal function without access restriction.
*
* May emit a {RoleRevoked} event.
*/
function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
if (hasRole(role, account)) {
_roles[role].hasRole[account] = false;
emit RoleRevoked(role, account, _msgSender());
return true;
} else {
return false;
}
}
}
// File: contracts/Final/app/WmbApp.sol
pragma solidity ^0.8.0;
/**
* @title WmbApp
* @dev Abstract contract to be inherited by applications to use Wanchain Message Bridge for send and receive messages between different chains.
* All interfaces with WmbGateway have been encapsulated, so users do not need to have any interaction with the WmbGateway contract.
*/
abstract contract WmbApp is AccessControl, Initializable, IWmbReceiver {
// The address of the WMB Gateway contract
address public wmbGateway;
// A mapping of remote chains and addresses that are trusted to send messages to this contract
// fromChainId => fromAddress => trusted
mapping (uint => mapping(address => bool)) public trustedRemotes;
/**
* @dev Initializes the contract with the given admin, WMB Gateway address, and block mode flag
* @param admin Address of the contract admin
* @param _wmbGateway Address of the WMB Gateway contract
*/
function initialize(address admin, address _wmbGateway) virtual public initializer {
// Initialize the AccessControl module with the given admin
_grantRole(DEFAULT_ADMIN_ROLE, admin);
wmbGateway = _wmbGateway;
}
/**
* @dev Function to set the trusted remote addresses
* @param fromChainIds IDs of the chains the messages are from
* @param froms Addresses of the contracts the messages are from
* @param trusted Trusted flag
* @notice This function can only be called by the admin
*/
function setTrustedRemotes(uint[] calldata fromChainIds, address[] calldata froms, bool[] calldata trusted) external {
require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "WmbApp: must have admin role to set trusted remotes");
require(fromChainIds.length == froms.length && froms.length == trusted.length, "WmbApp: invalid input");
for (uint i = 0; i < fromChainIds.length; i++) {
trustedRemotes[fromChainIds[i]][froms[i]] = trusted[i];
}
}
/**
* @dev Function to estimate fee in native coin for sending a message to the WMB Gateway
* @param toChain ID of the chain the message is to
* @param gasLimit Gas limit for the message
* @return fee Fee in native coin
*/
function estimateFee(uint256 toChain, uint256 gasLimit) virtual public view returns (uint256) {
return IWmbGateway(wmbGateway).estimateFee(toChain, gasLimit);
}
/**
* @dev Function to receive a WMB message from the WMB Gateway
* @param data Message data
* @param messageId Message ID
* @param fromChainId ID of the chain the message is from
* @param from Address of the contract the message is from
*/
function wmbReceive(
bytes calldata data,
bytes32 messageId,
uint256 fromChainId,
address from
) virtual external {
// Only the WMB gateway can call this function
require(msg.sender == wmbGateway, "WmbApp: Only WMB gateway can call this function");
require(trustedRemotes[fromChainId][from], "WmbApp: Remote is not trusted");
_wmbReceive(data, messageId, fromChainId, from);
}
/**
* @dev Function to be implemented by the application to handle received WMB messages
* @param data Message data
* @param messageId Message ID
* @param fromChainId ID of the chain the message is from
* @param from Address of the contract the message is from
*/
function _wmbReceive(
bytes calldata data,
bytes32 messageId,
uint256 fromChainId,
address from
) virtual internal;
/**
* @dev Function to send a WMB message to the WMB Gateway from this App
* @param toChainId ID of the chain the message is to
* @param to Address of the contract the message is to
* @param data Message data
* @return messageId Message ID
*/
function _dispatchMessage(
uint toChainId,
address to,
bytes memory data,
uint fee
) virtual internal returns (bytes32) {
return IWmbGateway(wmbGateway).dispatchMessage{value: fee}(toChainId, to, data);
}
/**
* @dev Function to send batch WMB messages to the WMB Gateway from this App
* @param toChainId ID of the chain the message is to
* @param messages Messages data
* @return messageId Message ID
*/
function _dispatchMessageBatch(uint256 toChainId, Message[] memory messages, uint fee) virtual internal returns (bytes32) {
return IWmbGateway(wmbGateway).dispatchMessageBatch{value: fee}(toChainId, messages);
}
}
// File: @openzeppelin/contracts/security/ReentrancyGuard.sol
// OpenZeppelin Contracts (last updated v4.9.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
/**
* @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a
* `nonReentrant` function in the call stack.
*/
function _reentrancyGuardEntered() internal view returns (bool) {
return _status == _ENTERED;
}
}
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts (last updated v4.9.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// File: @openzeppelin/contracts/utils/Address.sol
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Address.sol)
pragma solidity ^0.8.20;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev The ETH balance of the account is not enough to perform the operation.
*/
error AddressInsufficientBalance(address account);
/**
* @dev There's no code at `target` (it is not a contract).
*/
error AddressEmptyCode(address target);
/**
* @dev A call to an address target failed. The target may have reverted.
*/
error FailedInnerCall();
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://consensys.net/diligence/blog/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.8.20/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
if (address(this).balance < amount) {
revert AddressInsufficientBalance(address(this));
}
(bool success, ) = recipient.call{value: amount}("");
if (!success) {
revert FailedInnerCall();
}
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason or custom error, it is bubbled
* up by this function (like regular Solidity function calls). However, if
* the call reverted with no returned reason, this function reverts with a
* {FailedInnerCall} error.
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*/
function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
if (address(this).balance < value) {
revert AddressInsufficientBalance(address(this));
}
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResultFromTarget(target, success, returndata);
}
/**
* @dev Tool to verify that a low level call to smart-contract was successful, and reverts if the target
* was not a contract or bubbling up the revert reason (falling back to {Fail...
// [truncated — 68284 bytes total]
Read Contract
DEFAULT_ADMIN_ROLE 0xa217fddf → bytes32
FEE 0xc57981b5 → uint256
estimateFee 0x00e1d8d0 → uint256
feeEnabled 0xa771ebc7 → bool
getRoleAdmin 0x248a9ca3 → bytes32
hasRole 0x91d14854 → bool
marketingAddress 0xa5ece941 → address
poolToken 0xcbdf382c → address
remotePools 0xbf4512d3 → address
supportsInterface 0x01ffc9a7 → bool
trustedRemotes 0xe3d4683b → bool
wmbGateway 0x3088a5f9 → address
Write Contract 10 functions
These functions modify contract state and require a wallet transaction to execute.
configRemotePool 0xc2b8b094
uint256 chainId
address remotePool
crossTo 0x8f684b65
uint256 toChainId
uint256 amount
grantRole 0x2f2ff15d
bytes32 role
address account
initialize 0x485cc955
address admin
address _wmbGateway
renounceRole 0x36568abe
bytes32 role
address callerConfirmation
revokeRole 0xd547741f
bytes32 role
address account
setFeeEnabled 0x0db474fa
bool _enabled
setMarketingWallet 0x5d098b38
address wallet
setTrustedRemotes 0x7f34071d
uint256[] fromChainIds
address[] froms
bool[] trusted
wmbReceive 0x3a1a5b76
bytes data
bytes32 messageId
uint256 fromChainId
address from
Token Balances (1)
View Transfers →Recent Transactions
No transactions found for this address