Address Contract Verified
Address
0xd52A5e99b746Ad777045AB4d7031edfAED32BE72
Balance
0 ETH
Nonce
1
Code Size
15567 bytes
Creator
0x4aCEb6E2...5344 at tx 0x86bac7fd...4f287f
Indexed Transactions
0
Contract Bytecode
15567 bytes
0x6080604052600436106100dc575f3560e01c8063758654c21161007e578063979161ad11610058578063979161ad146102ff578063accd79591461033b578063c489744b14610377578063daa17f49146103b3576100dc565b8063758654c21461025257806377dec6c31461028e5780638da5cb5b146102d5576100dc565b806324eea776116100ba57806324eea776146101825780635149606e146101b25780635e35359e146101ee5780635e57966d14610216576100dc565b806307e1fc7f146100e05780630f53e7651461011c5780631e04c9cb14610158575b5f80fd5b3480156100eb575f80fd5b50610106600480360381019061010191906126b6565b6103dd565b60405161011391906127e8565b60405180910390f35b348015610127575f80fd5b50610142600480360381019061013d9190612801565b610842565b60405161014f9190612a1e565b60405180910390f35b348015610163575f80fd5b5061016c610b4c565b6040516101799190612a4d565b60405180910390f35b61019c60048036038101906101979190612a66565b610b71565b6040516101a991906127e8565b60405180910390f35b3480156101bd575f80fd5b506101d860048036038101906101d39190612801565b61158a565b6040516101e591906127e8565b60405180910390f35b3480156101f9575f80fd5b50610214600480360381019061020f9190612b0a565b611780565b005b348015610221575f80fd5b5061023c60048036038101906102379190612b5a565b611ac7565b6040516102499190612bcd565b60405180910390f35b34801561025d575f80fd5b5061027860048036038101906102739190612b5a565b611dc2565b6040516102859190612bfc565b60405180910390f35b348015610299575f80fd5b506102b460048036038101906102af9190612801565b611de2565b6040516102cc9c9b9a99989796959493929190612c24565b60405180910390f35b3480156102e0575f80fd5b506102e961204c565b6040516102f69190612a4d565b60405180910390f35b34801561030a575f80fd5b5061032560048036038101906103209190612801565b612070565b60405161033291906127e8565b60405180910390f35b348015610346575f80fd5b50610361600480360381019061035c9190612d2c565b6120a5565b60405161036e91906127e8565b60405180910390f35b348015610382575f80fd5b5061039d60048036038101906103989190612d57565b612156565b6040516103aa9190612bfc565b60405180910390f35b3480156103be575f80fd5b506103c7612277565b6040516103d49190612a4d565b60405180910390f35b5f80895111610421576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161041890612ddf565b60405180910390fd5b5f8811610463576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161045a90612e47565b60405180910390fd5b5f8751116104a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161049d90612eaf565b60405180910390fd5b5f8a51116104e9576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104e090612f17565b60405180910390fd5b898051906020012060018b6040516105019190612f6f565b90815260200160405180910390205f0160405161051e919061307e565b604051809103902003610566576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161055d906130de565b60405180910390fd5b5f6001830361057457600190505b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16146105de57600160028c6040516105b99190612f6f565b90815260200160405180910390205f6101000a81548160ff0219169083151502179055505b6040518061018001604052808c81526020013373ffffffffffffffffffffffffffffffffffffffff1681526020018b81526020018573ffffffffffffffffffffffffffffffffffffffff1681526020018a81526020018981526020018881526020018781526020018681526020015f151581526020015f1515815260200182151581525060018c6040516106729190612f6f565b90815260200160405180910390205f820151815f0190816106939190613299565b506020820151816001015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060408201518160020190816106ef9190613299565b506060820151816003015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506080820151816004015560a08201518160050190816107559190613299565b5060c0820151816006015560e082015181600701556101008201518160080155610120820151816009015f6101000a81548160ff0219169083151502179055506101408201518160090160016101000a81548160ff0219169083151502179055506101608201518160090160026101000a81548160ff0219169083151502179055509050503373ffffffffffffffffffffffffffffffffffffffff167f48647a40ef485b25981312d3df5828686268368d0731654dcb2eb76d58c25f0e8c8b8b8b8b604051610828959493929190613368565b60405180910390a260019150509998505050505050505050565b61084a6123fa565b60018260405161085a9190612f6f565b9081526020016040518091039020604051806101800160405290815f8201805461088390612fb2565b80601f01602080910402602001604051908101604052809291908181526020018280546108af90612fb2565b80156108fa5780601f106108d1576101008083540402835291602001916108fa565b820191905f5260205f20905b8154815290600101906020018083116108dd57829003601f168201915b50505050508152602001600182015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160028201805461096890612fb2565b80601f016020809104026020016040519081016040528092919081815260200182805461099490612fb2565b80156109df5780601f106109b6576101008083540402835291602001916109df565b820191905f5260205f20905b8154815290600101906020018083116109c257829003601f168201915b50505050508152602001600382015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160048201548152602001600582018054610a5790612fb2565b80601f0160208091040260200160405190810160405280929190818152602001828054610a8390612fb2565b8015610ace5780601f10610aa557610100808354040283529160200191610ace565b820191905f5260205f20905b815481529060010190602001808311610ab157829003601f168201915b50505050508152602001600682015481526020016007820154815260200160088201548152602001600982015f9054906101000a900460ff161515151581526020016009820160019054906101000a900460ff161515151581526020016009820160029054906101000a900460ff1615151515815250509050919050565b60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b5f80600185604051610b839190612f6f565b90815260200160405180910390209050838051906020012081600201604051610bac919061307e565b604051809103902014610bf4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610beb90613411565b60405180910390fd5b5f15158160090160019054906101000a900460ff16151514610c4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4290613479565b60405180910390fd5b8480519060200120815f01604051610c63919061307e565b604051809103902014610cab576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ca2906134e1565b60405180910390fd5b82604051602001610cbc9190612f6f565b6040516020818303038152906040528051906020012081600501604051602001610ce6919061357f565b6040516020818303038152906040528051906020012014610d3c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d3390612eaf565b60405180910390fd5b80600801544210610d82576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d79906135df565b60405180910390fd5b600285604051610d929190612f6f565b90815260200160405180910390205f9054906101000a900460ff1615611304578060090160029054906101000a900460ff1615611038575f816003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166323b872dd333085600401546040518463ffffffff1660e01b8152600401610e31939291906135fd565b5f604051808303815f87803b158015610e48575f80fd5b505af1158015610e5a573d5f803e3d5ffd5b505050508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684600601546040518363ffffffff1660e01b8152600401610ebe929190613684565b5f604051808303815f87803b158015610ed5575f80fd5b505af1158015610ee7573d5f803e3d5ffd5b505050505f82600701541115610f85578073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684600701546040518363ffffffff1660e01b8152600401610f57929190613684565b5f604051808303815f87803b158015610f6e575f80fd5b505af1158015610f80573d5f803e3d5ffd5b505050505b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb836001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846007015485600601548660040154610fde91906136d8565b610fe891906136d8565b6040518363ffffffff1660e01b8152600401611005929190613684565b5f604051808303815f87803b15801561101c575f80fd5b505af115801561102e573d5f803e3d5ffd5b50505050506112ff565b5f816003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff166323b872dd333085600401546040518463ffffffff1660e01b81526004016110a0939291906135fd565b6020604051808303815f875af11580156110bc573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906110e09190613735565b61111f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611116906137aa565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684600601546040518363ffffffff1660e01b815260040161117f929190613684565b6020604051808303815f875af115801561119b573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111bf9190613735565b6111fe576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111f5906137aa565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb836001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684600701548560060154866004015461125791906136d8565b61126191906136d8565b6040518363ffffffff1660e01b815260040161127e929190613684565b6020604051808303815f875af115801561129a573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112be9190613735565b6112fd576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112f4906137aa565b60405180910390fd5b505b6114df565b80600401543414611318826004015461229c565b6113213461229c565b604051602001611332929190613814565b60405160208183030381529060405290611382576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113799190612bcd565b60405180910390fd5b50806001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc8260070154836006015484600401546113d991906136d8565b6113e391906136d8565b90811502906040515f60405180830381858888f1935050505015801561140b573d5f803e3d5ffd5b5060035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc826006015490811502906040515f60405180830381858888f19350505050158015611474573d5f803e3d5ffd5b5060045f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166108fc826007015490811502906040515f60405180830381858888f193505050501580156114dd573d5f803e3d5ffd5b505b6001816009015f6101000a81548160ff02191690831515021790555060018160090160016101000a81548160ff0219169083151502179055507fc52d3c0fdb9f8c58b123b7372908015b3cf63ae1f159a92b134fc65932957295815f0133836001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16846004015460405161157694939291906138d6565b60405180910390a160019150509392505050565b5f7f0000000000000000000000004aceb6e23c1b9f5a4f320b2c0c741e679a4f534473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611619576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161161090613990565b60405180910390fd5b5f60018360405161162a9190612f6f565b90815260200160405180910390205f01805461164590612fb2565b905011611687576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161167e906139f8565b60405180910390fd5b6001826040516116979190612f6f565b90815260200160405180910390205f8082015f6116b49190612484565b600182015f6101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600282015f6116e99190612484565b600382015f6101000a81549073ffffffffffffffffffffffffffffffffffffffff0219169055600482015f9055600582015f6117259190612484565b600682015f9055600782015f9055600882015f9055600982015f6101000a81549060ff02191690556009820160016101000a81549060ff02191690556009820160026101000a81549060ff0219169055505060019050919050565b7f0000000000000000000000004aceb6e23c1b9f5a4f320b2c0c741e679a4f534473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461180e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161180590613990565b60405180910390fd5b611817836120a5565b1561199a575f839050818173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161185a9190613a16565b602060405180830381865afa158015611875573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906118999190613a43565b10156118da576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118d190613ab8565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401611915929190613ad6565b6020604051808303815f875af1158015611931573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906119559190613735565b611994576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198b906137aa565b60405180910390fd5b50611ac2565b5f839050818173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016119d89190613a16565b602060405180830381865afa1580156119f3573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a179190613a43565b1015611a58576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a4f90613ab8565b60405180910390fd5b8073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb84846040518363ffffffff1660e01b8152600401611a93929190613ad6565b5f604051808303815f87803b158015611aaa575f80fd5b505af1158015611abc573d5f803e3d5ffd5b50505050505b505050565b60605f8273ffffffffffffffffffffffffffffffffffffffff165f1b90505f6040518060400160405280601081526020017f303132333435363738396162636465660000000000000000000000000000000081525090505f603367ffffffffffffffff811115611b3a57611b39612505565b5b6040519080825280601f01601f191660200182016040528015611b6c5781602001600182028036833780820191505090505b5090507f3000000000000000000000000000000000000000000000000000000000000000815f81518110611ba357611ba2613afd565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110611c0657611c05613afd565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053505f5b6014811015611db65782600485600c84611c509190613b2a565b60208110611c6157611c60613afd565b5b1a60f81b7effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916901c60f81c60ff1681518110611ca057611c9f613afd565b5b602001015160f81c60f81b82600283611cb99190613b5d565b6002611cc59190613b2a565b81518110611cd657611cd5613afd565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a90535082600f60f81b85600c84611d189190613b2a565b60208110611d2957611d28613afd565b5b1a60f81b1660f81c60ff1681518110611d4557611d44613afd565b5b602001015160f81c60f81b82600283611d5e9190613b5d565b6003611d6a9190613b2a565b81518110611d7b57611d7a613afd565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a9053508080600101915050611c36565b50809350505050919050565b5f8173ffffffffffffffffffffffffffffffffffffffff16319050919050565b6001818051602081018201805184825260208301602085012081835280955050505050505f91509050805f018054611e1990612fb2565b80601f0160208091040260200160405190810160405280929190818152602001828054611e4590612fb2565b8015611e905780601f10611e6757610100808354040283529160200191611e90565b820191905f5260205f20905b815481529060010190602001808311611e7357829003601f168201915b505050505090806001015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806002018054611eca90612fb2565b80601f0160208091040260200160405190810160405280929190818152602001828054611ef690612fb2565b8015611f415780601f10611f1857610100808354040283529160200191611f41565b820191905f5260205f20905b815481529060010190602001808311611f2457829003601f168201915b505050505090806003015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806004015490806005018054611f8190612fb2565b80601f0160208091040260200160405190810160405280929190818152602001828054611fad90612fb2565b8015611ff85780601f10611fcf57610100808354040283529160200191611ff8565b820191905f5260205f20905b815481529060010190602001808311611fdb57829003601f168201915b505050505090806006015490806007015490806008015490806009015f9054906101000a900460ff16908060090160019054906101000a900460ff16908060090160029054906101000a900460ff1690508c565b7f0000000000000000000000004aceb6e23c1b9f5a4f320b2c0c741e679a4f534481565b6002818051602081018201805184825260208301602085012081835280955050505050505f915054906101000a900460ff1681565b5f8173ffffffffffffffffffffffffffffffffffffffff166318160ddd6040518163ffffffff1660e01b8152600401602060405180830381865afa92505050801561210e57506040513d601f19601f8201168201806040525081019061210b9190613a43565b60015b61214b573d805f811461213c576040519150601f19603f3d011682016040523d82523d5f602084013e612141565b606091505b505f915050612151565b60019150505b919050565b5f805f9050612164846120a5565b156121ed575f8490508073ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b81526004016121a69190613a16565b602060405180830381865afa1580156121c1573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906121e59190613a43565b91505061226d565b5f8490508073ffffffffffffffffffffffffffffffffffffffff166370a08231856040518263ffffffff1660e01b815260040161222a9190613a16565b602060405180830381865afa158015612245573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906122699190613a43565b9150505b8091505092915050565b60035f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60605f82036122e2576040518060400160405280600181526020017f300000000000000000000000000000000000000000000000000000000000000081525090506123f5565b5f8290505f5b5f82146123115780806122fa90613b9e565b915050600a8261230a9190613c12565b91506122e8565b5f8167ffffffffffffffff81111561232c5761232b612505565b5b6040519080825280601f01601f19166020018201604052801561235e5781602001600182028036833780820191505090505b5090505f8290508593505b5f84146123ed57600a8461237d9190613c42565b60306123899190613b2a565b60f81b828261239790613c72565b925082815181106123ab576123aa613afd565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff191690815f1a905350600a846123e69190613c12565b9350612369565b819450505050505b919050565b604051806101800160405280606081526020015f73ffffffffffffffffffffffffffffffffffffffff168152602001606081526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f8152602001606081526020015f81526020015f81526020015f81526020015f151581526020015f151581526020015f151581525090565b50805461249090612fb2565b5f825580601f106124a157506124be565b601f0160209004905f5260205f20908101906124bd91906124c1565b5b50565b5b808211156124d8575f815f9055506001016124c2565b5090565b5f604051905090565b5f80fd5b5f80fd5b5f80fd5b5f80fd5b5f601f19601f8301169050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b61253b826124f5565b810181811067ffffffffffffffff8211171561255a57612559612505565b5b80604052505050565b5f61256c6124dc565b90506125788282612532565b919050565b5f67ffffffffffffffff82111561259757612596612505565b5b6125a0826124f5565b9050602081019050919050565b828183375f83830152505050565b5f6125cd6125c88461257d565b612563565b9050828152602081018484840111156125e9576125e86124f1565b5b6125f48482856125ad565b509392505050565b5f82601f8301126126105761260f6124ed565b5b81356126208482602086016125bb565b91505092915050565b5f819050919050565b61263b81612629565b8114612645575f80fd5b50565b5f8135905061265681612632565b92915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f6126858261265c565b9050919050565b6126958161267b565b811461269f575f80fd5b50565b5f813590506126b08161268c565b92915050565b5f805f805f805f805f6101208a8c0312156126d4576126d36124e5565b5b5f8a013567ffffffffffffffff8111156126f1576126f06124e9565b5b6126fd8c828d016125fc565b99505060208a013567ffffffffffffffff81111561271e5761271d6124e9565b5b61272a8c828d016125fc565b985050604061273b8c828d01612648565b97505060608a013567ffffffffffffffff81111561275c5761275b6124e9565b5b6127688c828d016125fc565b96505060806127798c828d01612648565b95505060a061278a8c828d01612648565b94505060c061279b8c828d01612648565b93505060e06127ac8c828d016126a2565b9250506101006127be8c828d01612648565b9150509295985092959850929598565b5f8115159050919050565b6127e2816127ce565b82525050565b5f6020820190506127fb5f8301846127d9565b92915050565b5f60208284031215612816576128156124e5565b5b5f82013567ffffffffffffffff811115612833576128326124e9565b5b61283f848285016125fc565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f5b8381101561287f578082015181840152602081019050612864565b5f8484015250505050565b5f61289482612848565b61289e8185612852565b93506128ae818560208601612862565b6128b7816124f5565b840191505092915050565b5f6128cc8261265c565b9050919050565b6128dc816128c2565b82525050565b6128eb8161267b565b82525050565b6128fa81612629565b82525050565b612909816127ce565b82525050565b5f61018083015f8301518482035f86015261292a828261288a565b915050602083015161293f60208601826128d3565b5060408301518482036040860152612957828261288a565b915050606083015161296c60608601826128e2565b50608083015161297f60808601826128f1565b5060a083015184820360a0860152612997828261288a565b91505060c08301516129ac60c08601826128f1565b5060e08301516129bf60e08601826128f1565b506101008301516129d46101008601826128f1565b506101208301516129e9610120860182612900565b506101408301516129fe610140860182612900565b50610160830151612a13610160860182612900565b508091505092915050565b5f6020820190508181035f830152612a36818461290f565b905092915050565b612a47816128c2565b82525050565b5f602082019050612a605f830184612a3e565b92915050565b5f805f60608486031215612a7d57612a7c6124e5565b5b5f84013567ffffffffffffffff811115612a9a57612a996124e9565b5b612aa6868287016125fc565b935050602084013567ffffffffffffffff811115612ac757612ac66124e9565b5b612ad3868287016125fc565b925050604084013567ffffffffffffffff811115612af457612af36124e9565b5b612b00868287016125fc565b9150509250925092565b5f805f60608486031215612b2157612b206124e5565b5b5f612b2e868287016126a2565b9350506020612b3f868287016126a2565b9250506040612b5086828701612648565b9150509250925092565b5f60208284031215612b6f57612b6e6124e5565b5b5f612b7c848285016126a2565b91505092915050565b5f82825260208201905092915050565b5f612b9f82612848565b612ba98185612b85565b9350612bb9818560208601612862565b612bc2816124f5565b840191505092915050565b5f6020820190508181035f830152612be58184612b95565b905092915050565b612bf681612629565b82525050565b5f602082019050612c0f5f830184612bed565b92915050565b612c1e8161267b565b82525050565b5f610180820190508181035f830152612c3d818f612b95565b9050612c4c602083018e612a3e565b8181036040830152612c5e818d612b95565b9050612c6d606083018c612c15565b612c7a608083018b612bed565b81810360a0830152612c8c818a612b95565b9050612c9b60c0830189612bed565b612ca860e0830188612bed565b612cb6610100830187612bed565b612cc46101208301866127d9565b612cd26101408301856127d9565b612ce06101608301846127d9565b9d9c50505050505050505050505050565b5f612cfb8261267b565b9050919050565b612d0b81612cf1565b8114612d15575f80fd5b50565b5f81359050612d2681612d02565b92915050565b5f60208284031215612d4157612d406124e5565b5b5f612d4e84828501612d18565b91505092915050565b5f8060408385031215612d6d57612d6c6124e5565b5b5f612d7a858286016126a2565b9250506020612d8b858286016126a2565b9150509250929050565b7f496e76616c6964206275796572416464726573730000000000000000000000005f82015250565b5f612dc9601483612b85565b9150612dd482612d95565b602082019050919050565b5f6020820190508181035f830152612df681612dbd565b9050919050565b7f496e76616c696420616d6f756e740000000000000000000000000000000000005f82015250565b5f612e31600e83612b85565b9150612e3c82612dfd565b602082019050919050565b5f6020820190508181035f830152612e5e81612e25565b9050919050565b7f496e76616c69642063757272656e6379000000000000000000000000000000005f82015250565b5f612e99601083612b85565b9150612ea482612e65565b602082019050919050565b5f6020820190508181035f830152612ec681612e8d565b9050919050565b7f496e76616c6964206c697374696e6747756964000000000000000000000000005f82015250565b5f612f01601383612b85565b9150612f0c82612ecd565b602082019050919050565b5f6020820190508181035f830152612f2e81612ef5565b9050919050565b5f81905092915050565b5f612f4982612848565b612f538185612f35565b9350612f63818560208601612862565b80840191505092915050565b5f612f7a8284612f3f565b915081905092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f6002820490506001821680612fc957607f821691505b602082108103612fdc57612fdb612f85565b5b50919050565b5f81905092915050565b5f819050815f5260205f209050919050565b5f815461300a81612fb2565b6130148186612fe2565b9450600182165f811461302e576001811461304357613075565b60ff1983168652811515820286019350613075565b61304c85612fec565b5f5b8381101561306d5781548189015260018201915060208101905061304e565b838801955050505b50505092915050565b5f6130898284612ffe565b915081905092915050565b7f4c697374696e6720616c726561647920657869737473000000000000000000005f82015250565b5f6130c8601683612b85565b91506130d382613094565b602082019050919050565b5f6020820190508181035f8301526130f5816130bc565b9050919050565b5f819050815f5260205f209050919050565b5f6020601f8301049050919050565b5f82821b905092915050565b5f600883026131587fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8261311d565b613162868361311d565b95508019841693508086168417925050509392505050565b5f819050919050565b5f61319d61319861319384612629565b61317a565b612629565b9050919050565b5f819050919050565b6131b683613183565b6131ca6131c2826131a4565b848454613129565b825550505050565b5f90565b6131de6131d2565b6131e98184846131ad565b505050565b5b8181101561320c576132015f826131d6565b6001810190506131ef565b5050565b601f82111561325157613222816130fc565b61322b8461310e565b8101602085101561323a578190505b61324e6132468561310e565b8301826131ee565b50505b505050565b5f82821c905092915050565b5f6132715f1984600802613256565b1980831691505092915050565b5f6132898383613262565b9150826002028217905092915050565b6132a282612848565b67ffffffffffffffff8111156132bb576132ba612505565b5b6132c58254612fb2565b6132d0828285613210565b5f60209050601f831160018114613301575f84156132ef578287015190505b6132f9858261327e565b865550613360565b601f19841661330f866130fc565b5f5b8281101561333657848901518255600182019150602085019450602081019050613311565b86831015613353578489015161334f601f891682613262565b8355505b6001600288020188555050505b505050505050565b5f60a0820190508181035f8301526133808188612b95565b905061338f6020830187612bed565b81810360408301526133a18186612b95565b90506133b06060830185612bed565b6133bd6080830184612bed565b9695505050505050565b7f596f7520617265206e6f742061206275796572000000000000000000000000005f82015250565b5f6133fb601383612b85565b9150613406826133c7565b602082019050919050565b5f6020820190508181035f830152613428816133ef565b9050919050565b7f4c697374696e6720616c726561647920636f6d706c65746564000000000000005f82015250565b5f613463601983612b85565b915061346e8261342f565b602082019050919050565b5f6020820190508181035f83015261349081613457565b9050919050565b7f4e6f742074686520636f727265637420677569640000000000000000000000005f82015250565b5f6134cb601483612b85565b91506134d682613497565b602082019050919050565b5f6020820190508181035f8301526134f8816134bf565b9050919050565b5f815461350b81612fb2565b6135158186612f35565b9450600182165f811461352f576001811461354457613576565b60ff1983168652811515820286019350613576565b61354d856130fc565b5f5b8381101561356e5781548189015260018201915060208101905061354f565b838801955050505b50505092915050565b5f61358a82846134ff565b915081905092915050565b7f4c697374696e67204578706972656400000000000000000000000000000000005f82015250565b5f6135c9600f83612b85565b91506135d482613595565b602082019050919050565b5f6020820190508181035f8301526135f6816135bd565b9050919050565b5f6060820190506136105f830186612c15565b61361d6020830185612c15565b61362a6040830184612bed565b949350505050565b5f61364c6136476136428461265c565b61317a565b61265c565b9050919050565b5f61365d82613632565b9050919050565b5f61366e82613653565b9050919050565b61367e81613664565b82525050565b5f6040820190506136975f830185613675565b6136a46020830184612bed565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f6136e282612629565b91506136ed83612629565b9250828203905081811115613705576137046136ab565b5b92915050565b613714816127ce565b811461371e575f80fd5b50565b5f8151905061372f8161370b565b92915050565b5f6020828403121561374a576137496124e5565b5b5f61375784828501613721565b91505092915050565b7f546f6b656e207472616e73666572206661696c656400000000000000000000005f82015250565b5f613794601583612b85565b915061379f82613760565b602082019050919050565b5f6020820190508181035f8301526137c181613788565b9050919050565b7f496e636f727265637420616d6f756e7420746f20627579206c697374696e673a815250565b7f2d00000000000000000000000000000000000000000000000000000000000000815250565b5f61381e826137c8565b60208201915061382e8285612f3f565b9150613839826137ee565b6001820191506138498284612f3f565b91508190509392505050565b5f815461386181612fb2565b61386b8186612b85565b9450600182165f8114613885576001811461389b576138cd565b60ff1983168652811515602002860193506138cd565b6138a4856130fc565b5f5b838110156138c5578154818901526001820191506020810190506138a6565b808801955050505b50505092915050565b5f6080820190508181035f8301526138ee8187613855565b90506138fd6020830186612c15565b61390a6040830185613675565b6139176060830184612bed565b95945050505050565b7f4f6e6c79206f776e65722063616e2063616c6c20746869732066756e6374696f5f8201527f6e00000000000000000000000000000000000000000000000000000000000000602082015250565b5f61397a602183612b85565b915061398582613920565b604082019050919050565b5f6020820190508181035f8301526139a78161396e565b9050919050565b7f4c697374696e6720646f6573206e6f74206578697374000000000000000000005f82015250565b5f6139e2601683612b85565b91506139ed826139ae565b602082019050919050565b5f6020820190508181035f830152613a0f816139d6565b9050919050565b5f602082019050613a295f830184612c15565b92915050565b5f81519050613a3d81612632565b92915050565b5f60208284031215613a5857613a576124e5565b5b5f613a6584828501613a2f565b91505092915050565b7f496e73756666696369656e742062616c616e63650000000000000000000000005f82015250565b5f613aa2601483612b85565b9150613aad82613a6e565b602082019050919050565b5f6020820190508181035f830152613acf81613a96565b9050919050565b5f604082019050613ae95f830185612c15565b613af66020830184612bed565b9392505050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f613b3482612629565b9150613b3f83612629565b9250828201905080821115613b5757613b566136ab565b5b92915050565b5f613b6782612629565b9150613b7283612629565b9250828202613b8081612629565b91508282048414831517613b9757613b966136ab565b5b5092915050565b5f613ba882612629565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203613bda57613bd96136ab565b5b600182019050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f613c1c82612629565b9150613c2783612629565b925082613c3757613c36613be5565b5b828204905092915050565b5f613c4c82612629565b9150613c5783612629565b925082613c6757613c66613be5565b5b828206905092915050565b5f613c7c82612629565b91505f8203613c8e57613c8d6136ab565b5b60018203905091905056fea2646970667358221220b0dfbd234bfbf602ca5181dcf2648d4e7c7077e4614410d1d026e1e52625f62964736f6c63430008170033
Verified Source Code Full Match
Compiler: v0.8.23+commit.f704f362
EVM: shanghai
Optimization: No
escrow.sol 315 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.18;
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
interface NonERCToken {
function transfer(address recipient, uint256 amount) external;
function transferFrom(
address sender,
address recipient,
uint256 amount
) external;
function balanceOf(address account) external view returns (uint256);
}
contract NFTEscrow is ReentrancyGuard {
mapping(string => Listing) public listings;
mapping(string => bool) public requiresTokens;
address payable public immutable owner;
address payable public marketplaceAddress;
address payable public makerAddress;
constructor() {
owner = payable(msg.sender);
marketplaceAddress = payable(0x2FEA74160714A5Cbc556A24fAe5cCa5F29a05337);
makerAddress = payable(0x2FEA74160714A5Cbc556A24fAe5cCa5F29a05337);
}
modifier onlyOwner() {
require(msg.sender == owner, "Only owner can call this function");
_;
}
// Define an event
event PaymentProcessed(
string listingGuid,
address buyer,
address seller,
uint256 amount
);
event ListingCreated(
address indexed sellerAddress,
string listingGuid,
uint256 amount,
string currency,
uint256 marketplaceFee,
uint256 makerFee
);
struct Listing {
string listingGuid;
address payable sellerAddress;
string buyerGuid;
address tokenAddress;
uint256 amount;
string currency;
uint256 marketplaceFee;
uint256 makerFee;
uint256 endDate;
bool isPayed;
bool isCompleted;
bool IsTokenNonErc20;
}
function createListing(
string memory listingGuid,
string memory buyerGuid,
uint256 amount,
string memory currency,
uint256 marketplaceFee,
uint256 makerFee,
uint256 endDate,
address tokenAddress,
uint256 IsTokenNonErc20
) public returns (bool) {
require(bytes(buyerGuid).length > 0, "Invalid buyerAddress");
require(amount > 0, "Invalid amount");
require(bytes(currency).length > 0, "Invalid currency");
require(bytes(listingGuid).length > 0,"Invalid listingGuid");
require(
keccak256(bytes(listings[listingGuid].listingGuid)) != keccak256(bytes(listingGuid)),
"Listing already exists"
);
bool isNonERC20 = false;
if(IsTokenNonErc20 == 1){
isNonERC20 = true;
}
if (tokenAddress != address(0)) {
requiresTokens[listingGuid] = true;
}
listings[listingGuid] = Listing({
listingGuid:listingGuid,
sellerAddress: payable(msg.sender),
buyerGuid: buyerGuid,
amount: amount,
currency: currency,
marketplaceFee: marketplaceFee,
makerFee:makerFee,
endDate:endDate,
isPayed: false,
isCompleted: false,
tokenAddress: tokenAddress,
IsTokenNonErc20: isNonERC20
});
// Emit the event
emit ListingCreated(
msg.sender,
listingGuid,
amount,
currency,
marketplaceFee,
makerFee
);
return true;
}
// function to delete listing
function removeListing(string memory listingGuid) public onlyOwner returns (bool) {
require(bytes(listings[listingGuid].listingGuid).length > 0, "Listing does not exist");
delete listings[listingGuid];
return true;
}
// function to pay for Listing Id from buyer to seller
function paySeller(
string memory listingGuid,
string memory buyerGuid,
string memory currency
) public payable returns (bool) {
Listing storage listing = listings[listingGuid];
require(keccak256(bytes(listing.buyerGuid)) == keccak256(bytes(buyerGuid)), "You are not a buyer");
require(listing.isCompleted == false, "Listing already completed");
require(keccak256(bytes(listing.listingGuid)) == keccak256(bytes(listingGuid)),"Not the correct guid");
require(
keccak256(abi.encodePacked(listing.currency)) ==
keccak256(abi.encodePacked(currency)),
"Invalid currency"
);
require(block.timestamp < listing.endDate,"Listing Expired");
if (requiresTokens[listingGuid]) {
if (listing.IsTokenNonErc20) {
NonERCToken token = NonERCToken(listing.tokenAddress);
token.transferFrom(msg.sender, address(this), listing.amount);
token.transfer(marketplaceAddress, listing.marketplaceFee);
if(listing.makerFee > 0){
token.transfer(makerAddress, listing.makerFee);
}
token.transfer(
listing.sellerAddress,
listing.amount - listing.marketplaceFee - listing.makerFee
);
} else {
// Retrieve the ERC20 token contract
IERC20 token = IERC20(listing.tokenAddress);
require(
token.transferFrom(
msg.sender,
address(this),
listing.amount
),
"Token transfer failed"
);
require(
token.transfer(marketplaceAddress, listing.marketplaceFee),
"Token transfer failed"
);
require(
token.transfer(
listing.sellerAddress,
listing.amount - listing.marketplaceFee - listing.makerFee
),
"Token transfer failed"
);
}
} else {
require(
msg.value == listing.amount,
string.concat("Incorrect amount to buy listing:",uint2str(listing.amount),"-", uint2str(msg.value))
);
listing.sellerAddress.transfer(listing.amount - listing.marketplaceFee - listing.makerFee);
marketplaceAddress.transfer(listing.marketplaceFee);
makerAddress.transfer(listing.makerFee);
}
//listing.ownerof = msg.sender;
listing.isPayed = true;
listing.isCompleted = true;
emit PaymentProcessed(
listing.listingGuid,
msg.sender,
listing.sellerAddress,
listing.amount
);
return true;
}
function addressToString(address _addr) public pure returns(string memory)
{
bytes32 value = bytes32(uint256(uint160(_addr)));
bytes memory alphabet = "0123456789abcdef";
bytes memory str = new bytes(51);
str[0] = '0';
str[1] = 'x';
for (uint256 i = 0; i < 20; i++) {
str[2+i*2] = alphabet[uint8(value[i + 12] >> 4)];
str[3+i*2] = alphabet[uint8(value[i + 12] & 0x0f)];
}
return string(str);
}
function uint2str(
uint256 _i
)
internal
pure
returns (string memory str)
{
if (_i == 0)
{
return "0";
}
uint256 j = _i;
uint256 length;
while (j != 0)
{
length++;
j /= 10;
}
bytes memory bstr = new bytes(length);
uint256 k = length;
j = _i;
while (j != 0)
{
bstr[--k] = bytes1(uint8(48 + j % 10));
j /= 10;
}
str = string(bstr);
}
// Function to check token balance
function getTokenBalance(
address tokenAddress,
address accountAddress
) external view returns (uint256) {
uint256 balance = 0;
if (isERC20Token(IERC20(tokenAddress))) {
IERC20 token = IERC20(tokenAddress);
balance = token.balanceOf(accountAddress);
} else {
NonERCToken token = NonERCToken(tokenAddress);
balance = token.balanceOf(accountAddress);
}
return balance;
}
function readListing(string memory listingGuid) public view returns (Listing memory) {
return listings[listingGuid];
}
// Function to check coin balance
function getCoinBalance(
address walletAddress
) public view returns (uint256) {
return walletAddress.balance;
}
// Function to withdraw or transfer tokens to another address
function withdrawTokens(
address tokenAddress,
address to,
uint256 amount
) external onlyOwner {
if (isERC20Token(IERC20(tokenAddress))) {
// Retrieve the ERC20 token contract
IERC20 token = IERC20(tokenAddress);
// Ensure the contract has enough balance
require(
token.balanceOf(address(this)) >= amount,
"Insufficient balance"
);
// Transfer tokens to the specified address
require(token.transfer(to, amount), "Token transfer failed");
} else {
// Retrieve the NON ERC20 token contract
NonERCToken token = NonERCToken(tokenAddress);
// Ensure the contract has enough balance
require(
token.balanceOf(address(this)) >= amount,
"Insufficient balance"
);
token.transfer(to, amount);
}
}
// Function to check if a token supports the ERC20 interface
function isERC20Token(IERC20 token) public view returns (bool) {
try token.totalSupply() returns (uint256) {
return true;
} catch (bytes memory) {
return false;
}
}
}
IERC20.sol 79 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @dev Emitted when `value` tokens are moved from one account (`from`) to
* another (`to`).
*
* Note that `value` may be zero.
*/
event Transfer(address indexed from, address indexed to, uint256 value);
/**
* @dev Emitted when the allowance of a `spender` for an `owner` is set by
* a call to {approve}. `value` is the new allowance.
*/
event Approval(address indexed owner, address indexed spender, uint256 value);
/**
* @dev Returns the value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of tokens from the caller's account to `to`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address to, uint256 value) external returns (bool);
/**
* @dev Returns the remaining number of tokens that `spender` will be
* allowed to spend on behalf of `owner` through {transferFrom}. This is
* zero by default.
*
* This value changes when {approve} or {transferFrom} are called.
*/
function allowance(address owner, address spender) external view returns (uint256);
/**
* @dev Sets a `value` amount of tokens as the allowance of `spender` over the
* caller's tokens.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* IMPORTANT: Beware that changing an allowance with this method brings the risk
* that someone may use both the old and the new allowance by unfortunate
* transaction ordering. One possible solution to mitigate this race
* condition is to first reduce the spender's allowance to 0 and set the
* desired value afterwards:
* https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
*
* Emits an {Approval} event.
*/
function approve(address spender, uint256 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` is then deducted from the caller's
* allowance.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transferFrom(address from, address to, uint256 value) external returns (bool);
}
ReentrancyGuard.sol 77 lines
// SPDX-License-Identifier: MIT
// 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;
}
}
Read Contract
addressToString 0x5e57966d → string
getCoinBalance 0x758654c2 → uint256
getTokenBalance 0xc489744b → uint256
isERC20Token 0xaccd7959 → bool
listings 0x77dec6c3 → string, address, string, address, uint256, string, uint256, uint256, uint256, bool, bool, bool
makerAddress 0x1e04c9cb → address
marketplaceAddress 0xdaa17f49 → address
owner 0x8da5cb5b → address
readListing 0x0f53e765 → tuple
requiresTokens 0x979161ad → bool
Write Contract 4 functions
These functions modify contract state and require a wallet transaction to execute.
createListing 0x07e1fc7f
string listingGuid
string buyerGuid
uint256 amount
string currency
uint256 marketplaceFee
uint256 makerFee
uint256 endDate
address tokenAddress
uint256 IsTokenNonErc20
returns: bool
paySeller 0x24eea776
string listingGuid
string buyerGuid
string currency
returns: bool
removeListing 0x5149606e
string listingGuid
returns: bool
withdrawTokens 0x5e35359e
address tokenAddress
address to
uint256 amount
Recent Transactions
No transactions found for this address