Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xB729aef059C43DF124ED5B916cecCE83EC78724b
Balance 0 ETH
Nonce 1
Code Size 12116 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

12116 bytes
0x608060405234801561000f575f5ffd5b50600436106100cd575f3560e01c80636f9fb98a1161008a578063a88b5c4f11610064578063a88b5c4f1461023b578063d8aed1451461026b578063e2bbb15814610287578063e36fcbe9146102a3576100cd565b80636f9fb98a146101bd57806385edd715146101db5780639bc9fec91461020b576100cd565b80630fceb9ab146100d157806311eac855146100ed5780633a2a84f01461010b578063441a3e701461013b578063451d8f8f146101575780634a7f331c14610187575b5f5ffd5b6100eb60048036038101906100e6919061210d565b6102d3565b005b6100f56106f7565b6040516101029190612177565b60405180910390f35b610125600480360381019061012091906121b3565b61071b565b6040516101329190612200565b60405180910390f35b61015560048036038101906101509190612219565b6109cc565b005b610171600480360381019061016c9190612281565b611044565b60405161017e919061248b565b60405180910390f35b6101a1600480360381019061019c91906124ab565b6111ac565b6040516101b49796959493929190612507565b60405180910390f35b6101c561123a565b6040516101d29190612200565b60405180910390f35b6101f560048036038101906101f091906124ab565b6112d8565b6040516102029190612600565b60405180910390f35b610225600480360381019061022091906124ab565b61149e565b6040516102329190612200565b60405180910390f35b61025560048036038101906102509190612281565b6116ce565b6040516102629190612200565b60405180910390f35b61028560048036038101906102809190612219565b611716565b005b6102a1600480360381019061029c9190612219565b611b51565b005b6102bd60048036038101906102b891906124ab565b611ea7565b6040516102ca9190612619565b60405180910390f35b5f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490508110610354576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161034b9061268c565b60405180910390fd5b5f5f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2082815481106103a3576103a26126aa565b5b905f5260205f2090600702019050806006015f9054906101000a900460ff16610401576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016103f890612721565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16816004015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610492576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161048990612789565b60405180910390fd5b6001808111156104a5576104a46122d5565b5b815f015f9054906101000a900460ff1660018111156104c7576104c66122d5565b5b14610507576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016104fe906127f1565b60405180910390fd5b806001015481600201541015610552576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161054990612859565b60405180910390fd5b5f816003015414610598576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161058f906128c1565b60405180910390fd5b5f816002015490505f82600201819055505f826006015f6101000a81548160ff0219169083151502179055505f7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4890508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b81526004016106239291906128df565b6020604051808303815f875af115801561063f573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906106639190612930565b6106a2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610699906129a5565b60405180910390fd5b833373ffffffffffffffffffffffffffffffffffffffff167f8c961fe7dcee0b784718214651e1609de668a96d9662a187f3b9b798da7959ee846040516106e99190612200565b60405180910390a350505050565b7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4881565b5f5f821161075e576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161075590612a0d565b60405180910390fd5b64e8d4a510008211156107a6576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161079d90612a75565b60405180910390fd5b5f6040518060e001604052808560018111156107c5576107c46122d5565b5b81526020018481526020015f81526020015f81526020013373ffffffffffffffffffffffffffffffffffffffff1681526020014281526020016001151581525090505f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081908060018154018082558091505060019003905f5260205f2090600702015f909190919091505f820151815f015f6101000a81548160ff02191690836001811115610892576108916122d5565b5b02179055506020820151816001015560408201518160020155606082015181600301556080820151816004015f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060a0820151816005015560c0820151816006015f6101000a81548160ff021916908315150217905550505060015f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490506109729190612ac0565b9150813373ffffffffffffffffffffffffffffffffffffffff167fe4269fc83d481a6e8799dfa0b37e57a6ddd27e48897ce4dba459abe451e4181886866040516109bd929190612af3565b60405180910390a35092915050565b5f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490508210610a4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a449061268c565b60405180910390fd5b5f5f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208381548110610a9c57610a9b6126aa565b5b905f5260205f2090600702019050806006015f9054906101000a900460ff16610afa576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610af190612721565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16816004015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614610b8b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b8290612789565b60405180910390fd5b5f816002015411610bd1576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bc890612b64565b60405180910390fd5b5f6001811115610be457610be36122d5565b5b815f015f9054906101000a900460ff166001811115610c0657610c056122d5565b5b03610e0757806001015481600201541015610c56576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c4d90612859565b60405180910390fd5b5f816002015490505f82600201819055505f826006015f6101000a81548160ff0219169083151502179055505f7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4890508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33846040518363ffffffff1660e01b8152600401610ce19291906128df565b6020604051808303815f875af1158015610cfd573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610d219190612930565b610d60576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d57906129a5565b60405180910390fd5b843373ffffffffffffffffffffffffffffffffffffffff167f75e161b3e824b114fc1a33274bd7091918dd4e639cede50b78b15a4eea956a21845f604051610da9929190612bc4565b60405180910390a3843373ffffffffffffffffffffffffffffffffffffffff167f8c961fe7dcee0b784718214651e1609de668a96d9662a187f3b9b798da7959ee84604051610df89190612200565b60405180910390a3505061103f565b5f816003015414610e4d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e4490612c35565b60405180910390fd5b5f8211610e8f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e8690612c9d565b60405180910390fd5b5f60038260020154610ea19190612ce8565b905080831115610ee6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610edd90612d62565b60405180910390fd5b82826002015f828254610ef99190612ac0565b925050819055508282600301819055505f7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4890508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33866040518363ffffffff1660e01b8152600401610f689291906128df565b6020604051808303815f875af1158015610f84573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610fa89190612930565b610fe7576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fde906129a5565b60405180910390fd5b843373ffffffffffffffffffffffffffffffffffffffff167f75e161b3e824b114fc1a33274bd7091918dd4e639cede50b78b15a4eea956a21868660020154604051611034929190612d80565b60405180910390a350505b505050565b60605f5f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805480602002602001604051908101604052809291908181526020015f905b828210156111a1578382905f5260205f2090600702016040518060e00160405290815f82015f9054906101000a900460ff1660018111156110e5576110e46122d5565b5b60018111156110f7576110f66122d5565b5b8152602001600182015481526020016002820154815260200160038201548152602001600482015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160058201548152602001600682015f9054906101000a900460ff161515151581525050815260200190600101906110a1565b505050509050919050565b5f602052815f5260405f2081815481106111c4575f80fd5b905f5260205f2090600702015f9150915050805f015f9054906101000a900460ff1690806001015490806002015490806003015490806004015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690806005015490806006015f9054906101000a900460ff16905087565b5f7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4873ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016112949190612177565b602060405180830381865afa1580156112af573d5f5f3e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112d39190612dbb565b905090565b6112e0612076565b5f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490508210611361576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113589061268c565b60405180910390fd5b5f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2082815481106113af576113ae6126aa565b5b905f5260205f2090600702016040518060e00160405290815f82015f9054906101000a900460ff1660018111156113e9576113e86122d5565b5b60018111156113fb576113fa6122d5565b5b8152602001600182015481526020016002820154815260200160038201548152602001600482015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160058201548152602001600682015f9054906101000a900460ff161515151581525050905092915050565b5f5f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490508210611520576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115179061268c565b60405180910390fd5b5f5f5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20838154811061156f5761156e6126aa565b5b905f5260205f2090600702016040518060e00160405290815f82015f9054906101000a900460ff1660018111156115a9576115a86122d5565b5b60018111156115bb576115ba6122d5565b5b8152602001600182015481526020016002820154815260200160038201548152602001600482015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160058201548152602001600682015f9054906101000a900460ff161515151581525050905060018081111561166b5761166a6122d5565b5b815f01516001811115611681576116806122d5565b5b14158061169057508060c00151155b1561169e575f9150506116c8565b5f816060015111156116b3575f9150506116c8565b600381604001516116c49190612ce8565b9150505b92915050565b5f5f5f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490509050919050565b5f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490508210611797576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178e9061268c565b60405180910390fd5b5f5f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2083815481106117e6576117e56126aa565b5b905f5260205f2090600702019050806006015f9054906101000a900460ff16611844576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161183b90612721565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16816004015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16146118d5576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016118cc90612789565b60405180910390fd5b6001808111156118e8576118e76122d5565b5b815f015f9054906101000a900460ff16600181111561190a576119096122d5565b5b1461194a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611941906127f1565b60405180910390fd5b5f816003015411611990576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161198790612e30565b60405180910390fd5b5f821180156119a3575080600301548211155b6119e2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016119d990612e98565b60405180910390fd5b5f7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4890508073ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff1660e01b8152600401611a4393929190612eb6565b6020604051808303815f875af1158015611a5f573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611a839190612930565b611ac2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ab9906129a5565b60405180910390fd5b82826002015f828254611ad59190612eeb565b9250508190555082826003015f828254611aef9190612ac0565b92505081905550833373ffffffffffffffffffffffffffffffffffffffff167f07178c166b5aef4d8409e6bbfd0e7b1ad42c92eb65903a5e5482166f3f4e62f0858560030154604051611b43929190612d80565b60405180910390a350505050565b5f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490508210611bd2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611bc99061268c565b60405180910390fd5b5f5f5f3373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208381548110611c2157611c206126aa565b5b905f5260205f2090600702019050806006015f9054906101000a900460ff16611c7f576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c7690612721565b60405180910390fd5b3373ffffffffffffffffffffffffffffffffffffffff16816004015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1614611d10576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0790612789565b60405180910390fd5b5f8211611d52576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d4990612c9d565b60405180910390fd5b5f7f000000000000000000000000a0b86991c6218b36c1d19d4a2e9eb0ce3606eb4890508073ffffffffffffffffffffffffffffffffffffffff166323b872dd3330866040518463ffffffff1660e01b8152600401611db393929190612eb6565b6020604051808303815f875af1158015611dcf573d5f5f3e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611df39190612930565b611e32576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e29906129a5565b60405180910390fd5b82826002015f828254611e459190612eeb565b92505081905550833373ffffffffffffffffffffffffffffffffffffffff167f91ede45f04a37a7c170f5c1207df3b6bc748dc1e04ad5e917a241d0f52feada3858560020154604051611e99929190612d80565b60405180910390a350505050565b5f5f5f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20805490508210611f29576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f209061268c565b60405180910390fd5b5f5f5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f208381548110611f7857611f776126aa565b5b905f5260205f2090600702016040518060e00160405290815f82015f9054906101000a900460ff166001811115611fb257611fb16122d5565b5b6001811115611fc457611fc36122d5565b5b8152602001600182015481526020016002820154815260200160038201548152602001600482015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200160058201548152602001600682015f9054906101000a900460ff161515151581525050905080602001518160400151101591505092915050565b6040518060e001604052805f6001811115612094576120936122d5565b5b81526020015f81526020015f81526020015f81526020015f73ffffffffffffffffffffffffffffffffffffffff1681526020015f81526020015f151581525090565b5f5ffd5b5f819050919050565b6120ec816120da565b81146120f6575f5ffd5b50565b5f81359050612107816120e3565b92915050565b5f60208284031215612122576121216120d6565b5b5f61212f848285016120f9565b91505092915050565b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f61216182612138565b9050919050565b61217181612157565b82525050565b5f60208201905061218a5f830184612168565b92915050565b6002811061219c575f5ffd5b50565b5f813590506121ad81612190565b92915050565b5f5f604083850312156121c9576121c86120d6565b5b5f6121d68582860161219f565b92505060206121e7858286016120f9565b9150509250929050565b6121fa816120da565b82525050565b5f6020820190506122135f8301846121f1565b92915050565b5f5f6040838503121561222f5761222e6120d6565b5b5f61223c858286016120f9565b925050602061224d858286016120f9565b9150509250929050565b61226081612157565b811461226a575f5ffd5b50565b5f8135905061227b81612257565b92915050565b5f60208284031215612296576122956120d6565b5b5f6122a38482850161226d565b91505092915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602160045260245ffd5b60028110612313576123126122d5565b5b50565b5f81905061232382612302565b919050565b5f61233282612316565b9050919050565b61234281612328565b82525050565b612351816120da565b82525050565b61236081612157565b82525050565b5f8115159050919050565b61237a81612366565b82525050565b60e082015f8201516123945f850182612339565b5060208201516123a76020850182612348565b5060408201516123ba6040850182612348565b5060608201516123cd6060850182612348565b5060808201516123e06080850182612357565b5060a08201516123f360a0850182612348565b5060c082015161240660c0850182612371565b50505050565b5f6124178383612380565b60e08301905092915050565b5f602082019050919050565b5f612439826122ac565b61244381856122b6565b935061244e836122c6565b805f5b8381101561247e578151612465888261240c565b975061247083612423565b925050600181019050612451565b5085935050505092915050565b5f6020820190508181035f8301526124a3818461242f565b905092915050565b5f5f604083850312156124c1576124c06120d6565b5b5f6124ce8582860161226d565b92505060206124df858286016120f9565b9150509250929050565b6124f281612328565b82525050565b61250181612366565b82525050565b5f60e08201905061251a5f83018a6124e9565b61252760208301896121f1565b61253460408301886121f1565b61254160608301876121f1565b61254e6080830186612168565b61255b60a08301856121f1565b61256860c08301846124f8565b98975050505050505050565b60e082015f8201516125885f850182612339565b50602082015161259b6020850182612348565b5060408201516125ae6040850182612348565b5060608201516125c16060850182612348565b5060808201516125d46080850182612357565b5060a08201516125e760a0850182612348565b5060c08201516125fa60c0850182612371565b50505050565b5f60e0820190506126135f830184612574565b92915050565b5f60208201905061262c5f8301846124f8565b92915050565b5f82825260208201905092915050565b7f496e76616c696420626f784964000000000000000000000000000000000000005f82015250565b5f612676600d83612632565b915061268182612642565b602082019050919050565b5f6020820190508181035f8301526126a38161266a565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b7f426f78206e6f74206163746976650000000000000000000000000000000000005f82015250565b5f61270b600e83612632565b9150612716826126d7565b602082019050919050565b5f6020820190508181035f830152612738816126ff565b9050919050565b7f4e6f74206f776e657200000000000000000000000000000000000000000000005f82015250565b5f612773600983612632565b915061277e8261273f565b602082019050919050565b5f6020820190508181035f8301526127a081612767565b9050919050565b7f4f6e6c7920666f7220466c657869626c652074797065000000000000000000005f82015250565b5f6127db601683612632565b91506127e6826127a7565b602082019050919050565b5f6020820190508181035f830152612808816127cf565b9050919050565b7f546172676574206e6f74207265616368656400000000000000000000000000005f82015250565b5f612843601283612632565b915061284e8261280f565b602082019050919050565b5f6020820190508181035f83015261287081612837565b9050919050565b7f4d75737420726570617920616c6c207769746864726177616c730000000000005f82015250565b5f6128ab601a83612632565b91506128b682612877565b602082019050919050565b5f6020820190508181035f8301526128d88161289f565b9050919050565b5f6040820190506128f25f830185612168565b6128ff60208301846121f1565b9392505050565b61290f81612366565b8114612919575f5ffd5b50565b5f8151905061292a81612906565b92915050565b5f60208284031215612945576129446120d6565b5b5f6129528482850161291c565b91505092915050565b7f55534443207472616e73666572206661696c65640000000000000000000000005f82015250565b5f61298f601483612632565b915061299a8261295b565b602082019050919050565b5f6020820190508181035f8301526129bc81612983565b9050919050565b7f546172676574206d757374206265203e203000000000000000000000000000005f82015250565b5f6129f7601283612632565b9150612a02826129c3565b602082019050919050565b5f6020820190508181035f830152612a24816129eb565b9050919050565b7f4d617820314d20555344430000000000000000000000000000000000000000005f82015250565b5f612a5f600b83612632565b9150612a6a82612a2b565b602082019050919050565b5f6020820190508181035f830152612a8c81612a53565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f612aca826120da565b9150612ad5836120da565b9250828203905081811115612aed57612aec612a93565b5b92915050565b5f604082019050612b065f8301856124e9565b612b1360208301846121f1565b9392505050565b7f4e6f2062616c616e6365000000000000000000000000000000000000000000005f82015250565b5f612b4e600a83612632565b9150612b5982612b1a565b602082019050919050565b5f6020820190508181035f830152612b7b81612b42565b9050919050565b5f819050919050565b5f819050919050565b5f612bae612ba9612ba484612b82565b612b8b565b6120da565b9050919050565b612bbe81612b94565b82525050565b5f604082019050612bd75f8301856121f1565b612be46020830184612bb5565b9392505050565b7f4d7573742072657061792070726576696f7573207769746864726177616c00005f82015250565b5f612c1f601e83612632565b9150612c2a82612beb565b602082019050919050565b5f6020820190508181035f830152612c4c81612c13565b9050919050565b7f416d6f756e74206d757374206265203e203000000000000000000000000000005f82015250565b5f612c87601283612632565b9150612c9282612c53565b602082019050919050565b5f6020820190508181035f830152612cb481612c7b565b9050919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f612cf2826120da565b9150612cfd836120da565b925082612d0d57612d0c612cbb565b5b828204905092915050565b7f43616e6e6f74207769746864726177206d6f7265207468616e20312f330000005f82015250565b5f612d4c601d83612632565b9150612d5782612d18565b602082019050919050565b5f6020820190508181035f830152612d7981612d40565b9050919050565b5f604082019050612d935f8301856121f1565b612da060208301846121f1565b9392505050565b5f81519050612db5816120e3565b92915050565b5f60208284031215612dd057612dcf6120d6565b5b5f612ddd84828501612da7565b91505092915050565b7f4e6f7468696e6720746f207265706179000000000000000000000000000000005f82015250565b5f612e1a601083612632565b9150612e2582612de6565b602082019050919050565b5f6020820190508181035f830152612e4781612e0e565b9050919050565b7f496e76616c696420616d6f756e740000000000000000000000000000000000005f82015250565b5f612e82600e83612632565b9150612e8d82612e4e565b602082019050919050565b5f6020820190508181035f830152612eaf81612e76565b9050919050565b5f606082019050612ec95f830186612168565b612ed66020830185612168565b612ee360408301846121f1565b949350505050565b5f612ef5826120da565b9150612f00836120da565b9250828201905080821115612f1857612f17612a93565b5b9291505056fea264697066735822122010b92036f1ed136522bbfab1ebd033f3fb6eed3cded38808b53d358e8d064abd64736f6c634300081e0033

Verified Source Code Full Match

Compiler: v0.8.30+commit.73712a01 EVM: prague Optimization: No
USDCSavingsBank.sol 301 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

/**
 * @title USDCSavingsBank
 * @dev Smart contract for USDC savings boxes with two types
 *
 * Type 1 (Simple): Lock USDC until target amount is reached, no withdrawals until goal
 * Type 2 (Flexible): Lock USDC until target amount, but can withdraw up to 1/3, must repay before next withdrawal
 */

interface IERC20 {
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
    function transfer(address recipient, uint256 amount) external returns (bool);
    function balanceOf(address account) external view returns (uint256);
}

contract USDCSavingsBank {
    enum BoxType {
        Simple,      // Cannot withdraw until target reached
        Flexible     // Can withdraw max 1/3, must repay before next withdrawal
    }

    struct SavingsBox {
        BoxType boxType;           // Type of savings box
        uint256 targetAmount;      // Target amount to save
        uint256 currentBalance;    // Current saved amount
        uint256 withdrawnAmount;   // Amount withdrawn (for Flexible type)
        address owner;             // Owner of the box
        uint256 createdAt;         // Creation timestamp
        bool isActive;             // Is box active
    }

    // USDC token address
    address public immutable usdcToken;

    // User address => array of savings boxes
    mapping(address => SavingsBox[]) public userBoxes;

    // Events
    event BoxCreated(
        address indexed user,
        uint256 indexed boxId,
        BoxType boxType,
        uint256 targetAmount
    );

    event Deposited(
        address indexed user,
        uint256 indexed boxId,
        uint256 amount,
        uint256 newBalance
    );

    event Withdrawn(
        address indexed user,
        uint256 indexed boxId,
        uint256 amount,
        uint256 remainingBalance
    );

    event Repaid(
        address indexed user,
        uint256 indexed boxId,
        uint256 amount,
        uint256 newWithdrawnAmount
    );

    event BoxClosed(
        address indexed user,
        uint256 indexed boxId,
        uint256 finalAmount
    );

    /**
     * @dev Constructor sets USDC token address
     * @param _usdcToken Address of USDC token contract
     */
    constructor(address _usdcToken) {
        require(_usdcToken != address(0), "Invalid USDC address");
        usdcToken = _usdcToken;
    }

    /**
     * @dev Create a new savings box
     * @param boxType Type of box (0 = Simple, 1 = Flexible)
     * @param targetAmount Target amount to save (in USDC with 6 decimals)
     */
    function createSavingsBox(
        BoxType boxType,
        uint256 targetAmount
    ) external returns (uint256 boxId) {
        require(targetAmount > 0, "Target must be > 0");
        require(targetAmount <= 1_000_000 * 10**6, "Max 1M USDC");

        SavingsBox memory newBox = SavingsBox({
            boxType: boxType,
            targetAmount: targetAmount,
            currentBalance: 0,
            withdrawnAmount: 0,
            owner: msg.sender,
            createdAt: block.timestamp,
            isActive: true
        });

        userBoxes[msg.sender].push(newBox);
        boxId = userBoxes[msg.sender].length - 1;

        emit BoxCreated(msg.sender, boxId, boxType, targetAmount);

        return boxId;
    }

    /**
     * @dev Deposit USDC to savings box
     * @param boxId Index of the box
     * @param amount Amount to deposit
     */
    function deposit(uint256 boxId, uint256 amount) external {
        require(boxId < userBoxes[msg.sender].length, "Invalid boxId");
        SavingsBox storage box = userBoxes[msg.sender][boxId];

        require(box.isActive, "Box not active");
        require(box.owner == msg.sender, "Not owner");
        require(amount > 0, "Amount must be > 0");

        // Transfer USDC from user to contract
        IERC20 usdc = IERC20(usdcToken);
        require(
            usdc.transferFrom(msg.sender, address(this), amount),
            "USDC transfer failed"
        );

        box.currentBalance += amount;

        emit Deposited(msg.sender, boxId, amount, box.currentBalance);
    }

    /**
     * @dev Withdraw from savings box
     * @param boxId Index of the box
     * @param amount Amount to withdraw (0 = withdraw all for Simple type when target reached)
     */
    function withdraw(uint256 boxId, uint256 amount) external {
        require(boxId < userBoxes[msg.sender].length, "Invalid boxId");
        SavingsBox storage box = userBoxes[msg.sender][boxId];

        require(box.isActive, "Box not active");
        require(box.owner == msg.sender, "Not owner");
        require(box.currentBalance > 0, "No balance");

        if (box.boxType == BoxType.Simple) {
            // Simple type: can only withdraw when target is reached
            require(box.currentBalance >= box.targetAmount, "Target not reached");

            // Withdraw all
            uint256 withdrawAmount = box.currentBalance;
            box.currentBalance = 0;
            box.isActive = false;

            IERC20 usdc = IERC20(usdcToken);
            require(
                usdc.transfer(msg.sender, withdrawAmount),
                "USDC transfer failed"
            );

            emit Withdrawn(msg.sender, boxId, withdrawAmount, 0);
            emit BoxClosed(msg.sender, boxId, withdrawAmount);

        } else {
            // Flexible type: can withdraw up to 1/3, but must repay before next withdrawal
            require(box.withdrawnAmount == 0, "Must repay previous withdrawal");
            require(amount > 0, "Amount must be > 0");

            uint256 maxWithdraw = box.currentBalance / 3;
            require(amount <= maxWithdraw, "Cannot withdraw more than 1/3");

            box.currentBalance -= amount;
            box.withdrawnAmount = amount;

            IERC20 usdc = IERC20(usdcToken);
            require(
                usdc.transfer(msg.sender, amount),
                "USDC transfer failed"
            );

            emit Withdrawn(msg.sender, boxId, amount, box.currentBalance);
        }
    }

    /**
     * @dev Repay withdrawn amount (Flexible type only)
     * @param boxId Index of the box
     * @param amount Amount to repay
     */
    function repay(uint256 boxId, uint256 amount) external {
        require(boxId < userBoxes[msg.sender].length, "Invalid boxId");
        SavingsBox storage box = userBoxes[msg.sender][boxId];

        require(box.isActive, "Box not active");
        require(box.owner == msg.sender, "Not owner");
        require(box.boxType == BoxType.Flexible, "Only for Flexible type");
        require(box.withdrawnAmount > 0, "Nothing to repay");
        require(amount > 0 && amount <= box.withdrawnAmount, "Invalid amount");

        // Transfer USDC from user to contract
        IERC20 usdc = IERC20(usdcToken);
        require(
            usdc.transferFrom(msg.sender, address(this), amount),
            "USDC transfer failed"
        );

        box.currentBalance += amount;
        box.withdrawnAmount -= amount;

        emit Repaid(msg.sender, boxId, amount, box.withdrawnAmount);
    }

    /**
     * @dev Close box and withdraw all (Flexible type when target reached)
     * @param boxId Index of the box
     */
    function closeBox(uint256 boxId) external {
        require(boxId < userBoxes[msg.sender].length, "Invalid boxId");
        SavingsBox storage box = userBoxes[msg.sender][boxId];

        require(box.isActive, "Box not active");
        require(box.owner == msg.sender, "Not owner");
        require(box.boxType == BoxType.Flexible, "Only for Flexible type");
        require(box.currentBalance >= box.targetAmount, "Target not reached");
        require(box.withdrawnAmount == 0, "Must repay all withdrawals");

        uint256 finalAmount = box.currentBalance;
        box.currentBalance = 0;
        box.isActive = false;

        IERC20 usdc = IERC20(usdcToken);
        require(
            usdc.transfer(msg.sender, finalAmount),
            "USDC transfer failed"
        );

        emit BoxClosed(msg.sender, boxId, finalAmount);
    }

    /**
     * @dev Get all savings boxes for a user
     */
    function getUserBoxes(address user) external view returns (SavingsBox[] memory) {
        return userBoxes[user];
    }

    /**
     * @dev Get single box details
     */
    function getBox(address user, uint256 boxId) external view returns (SavingsBox memory) {
        require(boxId < userBoxes[user].length, "Invalid boxId");
        return userBoxes[user][boxId];
    }

    /**
     * @dev Get number of boxes for user
     */
    function getBoxCount(address user) external view returns (uint256) {
        return userBoxes[user].length;
    }

    /**
     * @dev Check if target is reached
     */
    function isTargetReached(address user, uint256 boxId) external view returns (bool) {
        require(boxId < userBoxes[user].length, "Invalid boxId");
        SavingsBox memory box = userBoxes[user][boxId];
        return box.currentBalance >= box.targetAmount;
    }

    /**
     * @dev Get available withdrawal amount (for Flexible type)
     */
    function getAvailableWithdrawal(address user, uint256 boxId) external view returns (uint256) {
        require(boxId < userBoxes[user].length, "Invalid boxId");
        SavingsBox memory box = userBoxes[user][boxId];

        if (box.boxType != BoxType.Flexible || !box.isActive) {
            return 0;
        }

        if (box.withdrawnAmount > 0) {
            return 0; // Must repay first
        }

        return box.currentBalance / 3;
    }

    /**
     * @dev Get contract USDC balance
     */
    function getContractBalance() external view returns (uint256) {
        return IERC20(usdcToken).balanceOf(address(this));
    }
}

Read Contract

getAvailableWithdrawal 0x9bc9fec9 → uint256
getBox 0x85edd715 → tuple
getBoxCount 0xa88b5c4f → uint256
getContractBalance 0x6f9fb98a → uint256
getUserBoxes 0x451d8f8f → tuple[]
isTargetReached 0xe36fcbe9 → bool
usdcToken 0x11eac855 → address
userBoxes 0x4a7f331c → uint8, uint256, uint256, uint256, address, uint256, bool

Write Contract 5 functions

These functions modify contract state and require a wallet transaction to execute.

closeBox 0x0fceb9ab
uint256 boxId
createSavingsBox 0x3a2a84f0
uint8 boxType
uint256 targetAmount
returns: uint256
deposit 0xe2bbb158
uint256 boxId
uint256 amount
repay 0xd8aed145
uint256 boxId
uint256 amount
withdraw 0x441a3e70
uint256 boxId
uint256 amount

Recent Transactions

No transactions found for this address