Cryo Explorer Ethereum Mainnet

Address Contract Verified

Address 0xd646CEca75b504a07C640111b8B5F6a7c6b68537
Balance 0 ETH
Nonce 1
Code Size 11107 bytes
Last Active
Indexed Transactions 19 (24,293,08224,460,041)
Gas Used (indexed) 483,176
External Etherscan · Sourcify

Contract Bytecode

11107 bytes
0x608060405234801561001057600080fd5b50600436106101c45760003560e01c8063715018a6116100f9578063b9a45aac11610097578063d9ddafb311610071578063d9ddafb31461052f578063dd62ed3e1461054b578063f2fde38b1461057b578063ff26786014610597576101c4565b8063b9a45aac146104c7578063ba1160eb146104e3578063d2dfd135146104ff576101c4565b806395d89b41116100d357806395d89b411461042d5780639c4ad6d41461044b578063a501242f1461047b578063a9059cbb14610497576101c4565b8063715018a6146103d557806386cf0862146103df5780638da5cb5b1461040f576101c4565b8063482cd6c5116101665780635d1751be116101405780635d1751be146103295780635eb08d8a146103595780636c24a76f1461037557806370a08231146103a5576101c4565b8063482cd6c5146102d1578063485d3834146102ef5780635ac8260c1461030d576101c4565b806318160ddd116101a257806318160ddd1461023557806323b872dd14610253578063313ce567146102835780633af32abf146102a1576101c4565b806303386e70146101c957806306fdde03146101e7578063095ea7b314610205575b600080fd5b6101d16105c7565b6040516101de91906120e2565b60405180910390f35b6101ef6105ed565b6040516101fc919061218d565b60405180910390f35b61021f600480360381019061021a919061221b565b61067f565b60405161022c9190612276565b60405180910390f35b61023d6106a2565b60405161024a91906122a0565b60405180910390f35b61026d600480360381019061026891906122bb565b6106b5565b60405161027a9190612276565b60405180910390f35b61028b6107cd565b604051610298919061232a565b60405180910390f35b6102bb60048036038101906102b69190612345565b6107d6565b6040516102c89190612276565b60405180910390f35b6102d961082c565b6040516102e6919061232a565b60405180910390f35b6102f7610843565b60405161030491906122a0565b60405180910390f35b61032760048036038101906103229190612345565b61084a565b005b610343600480360381019061033e9190612345565b61093c565b60405161035091906122a0565b60405180910390f35b610373600480360381019061036e919061239e565b610985565b005b61038f600480360381019061038a9190612345565b610a29565b60405161039c91906122a0565b60405180910390f35b6103bf60048036038101906103ba9190612345565b610bf8565b6040516103cc91906122a0565b60405180910390f35b6103dd610c40565b005b6103f960048036038101906103f49190612345565b610c54565b60405161040691906122a0565b60405180910390f35b610417610ca0565b60405161042491906120e2565b60405180910390f35b610435610cca565b604051610442919061218d565b60405180910390f35b61046560048036038101906104609190612345565b610d5c565b60405161047291906122a0565b60405180910390f35b61049560048036038101906104909190612430565b610da5565b005b6104b160048036038101906104ac919061221b565b610ea9565b6040516104be9190612276565b60405180910390f35b6104e160048036038101906104dc91906124a9565b610fbf565b005b6104fd60048036038101906104f891906124e9565b611070565b005b61051960048036038101906105149190612345565b6111c1565b60405161052691906122a0565b60405180910390f35b6105496004803603810190610544919061221b565b61120a565b005b61056560048036038101906105609190612549565b6113a0565b60405161057291906122a0565b60405180910390f35b61059560048036038101906105909190612345565b611427565b005b6105b160048036038101906105ac919061221b565b6114ad565b6040516105be91906125c7565b60405180910390f35b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6060600380546105fc90612611565b80601f016020809104026020016040519081016040528092919081815260200182805461062890612611565b80156106755780601f1061064a57610100808354040283529160200191610675565b820191906000526020600020905b81548152906001019060200180831161065857829003601f168201915b5050505050905090565b60008061068a61153b565b9050610697818585611543565b600191505092915050565b60006a52b7d2dcc80cd2e4000000905090565b600043600860008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610738576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161072f9061268e565b60405180910390fd5b6000600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054111561078b5761078a8483611555565b5b60006107978584611832565b905060008111156107ad576107ac85826118e2565b5b6107c3858583866107be91906126dd565b611964565b9150509392505050565b60006012905090565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff169050919050565b6000600660149054906101000a900460ff16905090565b62049d4081565b610852611993565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036108c1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108b89061275d565b60405180910390fd5b80600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055507fe0059455fdd25c57fb25084f4324530ca1e3b3d2f2dad393dc0f86b2376ebf028160405161093191906120e2565b60405180910390a150565b6000600b60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b61098d611993565b60648160ff1611156109d4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016109cb906127c9565b60405180910390fd5b80600660146101000a81548160ff021916908360ff1602179055507f14cc0202dfb90d275bde2c8c0a763320b491e3629a7ffcc5645b899d4fb0100481604051610a1e9190612824565b60405180910390a150565b600080600090506000600960008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610ad757838290600052602060002090600202016040518060400160405290816000820154815260200160018201548152505081526020019060010190610a91565b5050505090506000600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205490505b8151811015610b905743828281518110610b3f57610b3e61283f565b5b60200260200101516020015111610b7d57818181518110610b6357610b6261283f565b5b60200260200101516000015183610b7a919061286e565b92505b8080610b88906128a2565b915050610b22565b5081600a60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054610bdb86610bf8565b610be591906126dd565b610bef919061286e565b92505050919050565b60008060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610c48611993565b610c526000611a1a565b565b6000600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490509050919050565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b606060048054610cd990612611565b80601f0160208091040260200160405190810160405280929190818152602001828054610d0590612611565b8015610d525780601f10610d2757610100808354040283529160200191610d52565b820191906000526020600020905b815481529060010190602001808311610d3557829003601f168201915b5050505050905090565b6000600a60008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b610dad611993565b60005b82829050811015610ea457600060086000858585818110610dd457610dd361283f565b5b9050602002016020810190610de99190612345565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550828282818110610e3a57610e3961283f565b5b9050602002016020810190610e4f9190612345565b73ffffffffffffffffffffffffffffffffffffffff167fecc5387d11be70275ddf68c82c19d72f74b29be3c83f2f5a65c74789a53bed9d60405160405180910390a28080610e9c906128a2565b915050610db0565b505050565b600043600860003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205410610f2c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f239061268e565b60405180910390fd5b6000600a60003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541115610f7f57610f7e3383611555565b5b6000610f8b3384611832565b90506000811115610fa157610fa033826118e2565b5b610fb6848285610fb191906126dd565b611ae0565b91505092915050565b610fc7611993565b80600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508173ffffffffffffffffffffffffffffffffffffffff167faf367c7d20ce5b2ab6da56afd0c9c39b00ba995263c60292a3e1ee3781fd4885826040516110649190612276565b60405180910390a25050565b611078611993565b4381116110ba576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110b19061295c565b60405180910390fd5b60005b838390508110156111bb5781600860008686858181106110e0576110df61283f565b5b90506020020160208101906110f59190612345565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508383828181106111465761114561283f565b5b905060200201602081019061115b9190612345565b73ffffffffffffffffffffffffffffffffffffffff167fb7536ec9d2806a675644f41d1d6e8e099f1f96b02047f813ad94e6dc83f5004b836040516111a091906122a0565b60405180910390a280806111b3906128a2565b9150506110bd565b50505050565b6000600860008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff161461129a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611291906129c8565b60405180910390fd5b600960008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020604051806040016040528083815260200162049d40436112f9919061286e565b81525090806001815401808255809150506001900390600052602060002090600202016000909190919091506000820151816000015560208201518160010155505080600a60008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461138a919061286e565b9250508190555061139b8282610ea9565b505050565b6000600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b61142f611993565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036114a15760006040517f1e4fbdf700000000000000000000000000000000000000000000000000000000815260040161149891906120e2565b60405180910390fd5b6114aa81611a1a565b50565b6114b5612087565b600960008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106115065761150561283f565b5b906000526020600020906002020160405180604001604052908160008201548152602001600182015481525050905092915050565b600033905090565b6115508383836001611b03565b505050565b6000808290506000600b60008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905060008190505b600960008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020805490508110156116e1576000600960008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002082815481106116425761164161283f565b5b90600052602060002090600202019050438160010154116116cd578060000154841161169e578381600001600082825461167c91906126dd565b92505081905550838561168f919061286e565b945060009350819250506116e1565b8060000154856116ae919061286e565b94508060000154846116c091906126dd565b9350600081600001819055505b5080806116d9906128a2565b9150506115a5565b508383101561179157600083600a60008873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461173791906126dd565b61174087610bf8565b61174a91906126dd565b90508481101561178f576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161178690612a34565b60405180910390fd5b505b80600b60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555082600a60008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825461182491906126dd565b925050819055505050505050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156118a057506000600660149054906101000a900460ff1660ff16115b156118d757612710600660149054906101000a900460ff1660ff16836118c69190612a54565b6118d09190612ac5565b90506118dc565b600090505b92915050565b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036119545760006040517f96c6fd1e00000000000000000000000000000000000000000000000000000000815260040161194b91906120e2565b60405180910390fd5b61196082600083611cda565b5050565b60008061196f61153b565b905061197c858285611eff565b611987858585611f93565b60019150509392505050565b61199b61153b565b73ffffffffffffffffffffffffffffffffffffffff166119b9610ca0565b73ffffffffffffffffffffffffffffffffffffffff1614611a18576119dc61153b565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401611a0f91906120e2565b60405180910390fd5b565b6000600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905081600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b600080611aeb61153b565b9050611af8818585611f93565b600191505092915050565b600073ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff1603611b755760006040517fe602df05000000000000000000000000000000000000000000000000000000008152600401611b6c91906120e2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611be75760006040517f94280d62000000000000000000000000000000000000000000000000000000008152600401611bde91906120e2565b60405180910390fd5b81600160008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508015611cd4578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92584604051611ccb91906122a0565b60405180910390a35b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611d2c578060026000828254611d20919061286e565b92505081905550611dff565b60008060008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905081811015611db8578381836040517fe450d38c000000000000000000000000000000000000000000000000000000008152600401611daf93929190612af6565b60405180910390fd5b8181036000808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002081905550505b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611e485780600260008282540392505081905550611e95565b806000808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef83604051611ef291906122a0565b60405180910390a3505050565b6000611f0b84846113a0565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114611f8d5781811015611f7d578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401611f7493929190612af6565b60405180910390fd5b611f8c84848484036000611b03565b5b50505050565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036120055760006040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401611ffc91906120e2565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16036120775760006040517fec442f0500000000000000000000000000000000000000000000000000000000815260040161206e91906120e2565b60405180910390fd5b612082838383611cda565b505050565b604051806040016040528060008152602001600081525090565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b60006120cc826120a1565b9050919050565b6120dc816120c1565b82525050565b60006020820190506120f760008301846120d3565b92915050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561213757808201518184015260208101905061211c565b60008484015250505050565b6000601f19601f8301169050919050565b600061215f826120fd565b6121698185612108565b9350612179818560208601612119565b61218281612143565b840191505092915050565b600060208201905081810360008301526121a78184612154565b905092915050565b600080fd5b600080fd5b6121c2816120c1565b81146121cd57600080fd5b50565b6000813590506121df816121b9565b92915050565b6000819050919050565b6121f8816121e5565b811461220357600080fd5b50565b600081359050612215816121ef565b92915050565b60008060408385031215612232576122316121af565b5b6000612240858286016121d0565b925050602061225185828601612206565b9150509250929050565b60008115159050919050565b6122708161225b565b82525050565b600060208201905061228b6000830184612267565b92915050565b61229a816121e5565b82525050565b60006020820190506122b56000830184612291565b92915050565b6000806000606084860312156122d4576122d36121af565b5b60006122e2868287016121d0565b93505060206122f3868287016121d0565b925050604061230486828701612206565b9150509250925092565b600060ff82169050919050565b6123248161230e565b82525050565b600060208201905061233f600083018461231b565b92915050565b60006020828403121561235b5761235a6121af565b5b6000612369848285016121d0565b91505092915050565b61237b8161230e565b811461238657600080fd5b50565b60008135905061239881612372565b92915050565b6000602082840312156123b4576123b36121af565b5b60006123c284828501612389565b91505092915050565b600080fd5b600080fd5b600080fd5b60008083601f8401126123f0576123ef6123cb565b5b8235905067ffffffffffffffff81111561240d5761240c6123d0565b5b602083019150836020820283011115612429576124286123d5565b5b9250929050565b60008060208385031215612447576124466121af565b5b600083013567ffffffffffffffff811115612465576124646121b4565b5b612471858286016123da565b92509250509250929050565b6124868161225b565b811461249157600080fd5b50565b6000813590506124a38161247d565b92915050565b600080604083850312156124c0576124bf6121af565b5b60006124ce858286016121d0565b92505060206124df85828601612494565b9150509250929050565b600080600060408486031215612502576125016121af565b5b600084013567ffffffffffffffff8111156125205761251f6121b4565b5b61252c868287016123da565b9350935050602061253f86828701612206565b9150509250925092565b600080604083850312156125605761255f6121af565b5b600061256e858286016121d0565b925050602061257f858286016121d0565b9150509250929050565b612592816121e5565b82525050565b6040820160008201516125ae6000850182612589565b5060208201516125c16020850182612589565b50505050565b60006040820190506125dc6000830184612598565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061262957607f821691505b60208210810361263c5761263b6125e2565b5b50919050565b7f41646472657373206973206c6f636b6564000000000000000000000000000000600082015250565b6000612678601183612108565b915061268382612642565b602082019050919050565b600060208201905081810360008301526126a78161266b565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006126e8826121e5565b91506126f3836121e5565b925082820390508181111561270b5761270a6126ae565b5b92915050565b7f496e76616c696420616464726573730000000000000000000000000000000000600082015250565b6000612747600f83612108565b915061275282612711565b602082019050919050565b600060208201905081810360008301526127768161273a565b9050919050565b7f4275726e20726174652063616e6e6f7420657863656564203125000000000000600082015250565b60006127b3601a83612108565b91506127be8261277d565b602082019050919050565b600060208201905081810360008301526127e2816127a6565b9050919050565b6000819050919050565b600061280e6128096128048461230e565b6127e9565b6121e5565b9050919050565b61281e816127f3565b82525050565b60006020820190506128396000830184612815565b92915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000612879826121e5565b9150612884836121e5565b925082820190508082111561289c5761289b6126ae565b5b92915050565b60006128ad826121e5565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff82036128df576128de6126ae565b5b600182019050919050565b7f556e6c6f636b20626c6f636b206d75737420626520696e20746865206675747560008201527f7265000000000000000000000000000000000000000000000000000000000000602082015250565b6000612946602283612108565b9150612951826128ea565b604082019050919050565b6000602082019050818103600083015261297581612939565b9050919050565b7f496e76616c69642063616c6c6572000000000000000000000000000000000000600082015250565b60006129b2600e83612108565b91506129bd8261297c565b602082019050919050565b600060208201905081810360008301526129e1816129a5565b9050919050565b7f496e73756666696369656e7420617661696c61626c652062616c616e63650000600082015250565b6000612a1e601e83612108565b9150612a29826129e8565b602082019050919050565b60006020820190508181036000830152612a4d81612a11565b9050919050565b6000612a5f826121e5565b9150612a6a836121e5565b9250828202612a78816121e5565b91508282048414831517612a8f57612a8e6126ae565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000612ad0826121e5565b9150612adb836121e5565b925082612aeb57612aea612a96565b5b828204905092915050565b6000606082019050612b0b60008301866120d3565b612b186020830185612291565b612b256040830184612291565b94935050505056fea2646970667358221220a66434d1535a01b9c0baecc889ed1a0c4f591a79f08874ce3d277f5dbcc1788764736f6c63430008140033

Verified Source Code Full Match

Compiler: v0.8.20+commit.a1b79de6 EVM: istanbul Optimization: No
Barkcoin.sol 190 lines
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract Barkcoin is ERC20, Ownable {

    uint256 private constant TOTAL_SUPPLY = 1e26;
    uint256 public constant LOCK_DURATION = 302400;// 42 days

    address public barkcoinContorl;
    uint8 private _burnRate;
    mapping(address => bool) private _whitelist;
    mapping(address => uint256) private _lockUntilBlock;

    struct LockInfo {
        uint256 amount;
        uint256 unlockBlock;
    }

    mapping(address => LockInfo[]) private _exchangeLocks;
    mapping(address => uint256) private _exchangeTotal;
    mapping(address => uint256) private _exchangeIndex;

    event ControlChanged(address newControl);
    event BurnRateChanged(uint256 newBurnRate);
    event AddressWhitelisted(address indexed account, bool state);
    event AddressLocked(address indexed account, uint256 unlockBlock);
    event AddressUnlocked(address indexed account);

    modifier checkExchange() {
        require(msg.sender == barkcoinContorl, "Invalid caller");
        _;
    }

    constructor(address initialOwner, string memory _name, string memory _symbol) ERC20(_name, _symbol) Ownable(initialOwner) {
        _mint(initialOwner, TOTAL_SUPPLY);
    }

    function burnCompute(address from, uint256 amount) internal view returns (uint256) {
        if (!_whitelist[from] && _burnRate > 0) {
            return (amount * _burnRate) / 10000;
        }
        return 0;
    }

    function exchangeCompute(address from, uint256 amount) internal {
        uint256 unlockAmount = 0;
        uint256 remainingAmount = amount;
        uint256 index = _exchangeIndex[from];

        for (uint256 i = index; i < _exchangeLocks[from].length; i++) {
            LockInfo storage lockInfo = _exchangeLocks[from][i];

            if (lockInfo.unlockBlock <= block.number) {
                if (remainingAmount <= lockInfo.amount) {
                    lockInfo.amount -= remainingAmount;
                    unlockAmount += remainingAmount;
                    remainingAmount = 0;
                    index = i;
                    break;
                } else {
                    unlockAmount += lockInfo.amount;
                    remainingAmount -= lockInfo.amount;
                    lockInfo.amount = 0;
                }
            }
        }

        if (unlockAmount < amount) {
            uint256 availableBalance = balanceOf(from) - (_exchangeTotal[from] - unlockAmount);
            require(availableBalance >= amount, "Insufficient available balance");
        }

        _exchangeIndex[from] = index;
        _exchangeTotal[from] -= unlockAmount;
    }

    function setControl(address control) external onlyOwner {
        require(control != address(0), "Invalid address");
        barkcoinContorl = control;
        emit ControlChanged(control);
    }

    function setBurnRate(uint8 burnRate) external onlyOwner {
        require(burnRate <= 100, "Burn rate cannot exceed 1%");
        _burnRate = burnRate;
        emit BurnRateChanged(burnRate);
    }

    function whitelistAddress(address account, bool state) external onlyOwner {
        _whitelist[account] = state;
        emit AddressWhitelisted(account, state);
    }

    function lockAddresses(address[] calldata accounts, uint256 unlockBlock) external onlyOwner {
        require(unlockBlock > block.number, "Unlock block must be in the future");
        for (uint256 i = 0; i < accounts.length; i++) {
            _lockUntilBlock[accounts[i]] = unlockBlock;
            emit AddressLocked(accounts[i], unlockBlock);
        }
    }

    function unlockAddresses(address[] calldata accounts) external onlyOwner {
        for (uint256 i = 0; i < accounts.length; i++) {
            _lockUntilBlock[accounts[i]] = 0;
            emit AddressUnlocked(accounts[i]);
        }
    }

    function transfer(address recipient, uint256 amount) public override returns (bool) {
        require(_lockUntilBlock[msg.sender] < block.number, "Address is locked");
        if (_exchangeTotal[msg.sender] > 0) {
            exchangeCompute(msg.sender, amount);
        }

        uint256 burnAmount = burnCompute(msg.sender, amount);
        if (burnAmount > 0) {
            _burn(msg.sender, burnAmount);
        }

        return super.transfer(recipient, amount - burnAmount);
    }

    function transferFrom(address sender, address recipient, uint256 amount) public override returns (bool) {
        require(_lockUntilBlock[sender] < block.number, "Address is locked");
        if (_exchangeTotal[sender] > 0) {
            exchangeCompute(sender, amount);
        }

        uint256 burnAmount = burnCompute(sender, amount);
        if (burnAmount > 0) {
            _burn(sender, burnAmount);
        }
        return super.transferFrom(sender, recipient, amount - burnAmount);
    }

    function exchangeTransfer(address recipient, uint256 amount) public checkExchange {
        _exchangeLocks[recipient].push(LockInfo({
            amount: amount,
            unlockBlock: block.number + LOCK_DURATION
        }));
        _exchangeTotal[recipient] += amount;
        transfer(recipient, amount);
    }

    function getBurnRate() external view returns (uint8) {
        return _burnRate;
    }

    function isWhitelisted(address account) external view returns (bool) {
        return _whitelist[account];
    }

    function getLockUntilBlock(address account) external view returns (uint256) {
        return _lockUntilBlock[account];
    }

    function totalSupply() public pure override returns (uint256) {
        return TOTAL_SUPPLY;
    }

    function getExchangeLockLength(address from) external view returns (uint256) {
        return _exchangeLocks[from].length;
    }

    function getExchangeIndex(address from) external view returns (uint256) {
        return _exchangeIndex[from];
    }

    function getExchangeLock(address from, uint256 index) external view returns (LockInfo memory) {
        return _exchangeLocks[from][index];
    }

    function getExchangeBalance(address from) public view returns (uint256) {
        return _exchangeTotal[from];
    }

    function getAvailableBalance(address from) public view returns (uint256) {
        uint256 lockedAmount = 0;
        LockInfo[] memory locks = _exchangeLocks[from];
        for (uint256 i = _exchangeIndex[from]; i < locks.length; i++) {
            if (locks[i].unlockBlock <= block.number) {
                lockedAmount += locks[i].amount;
            }
        }
        return balanceOf(from) - _exchangeTotal[from] + lockedAmount;
    }
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}
Ownable.sol 100 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)

pragma solidity ^0.8.20;

import {Context} from "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * The initial owner is set to the address provided by the deployer. This can
 * later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    /**
     * @dev The caller account is not authorized to perform an operation.
     */
    error OwnableUnauthorizedAccount(address account);

    /**
     * @dev The owner is not a valid owner account. (eg. `address(0)`)
     */
    error OwnableInvalidOwner(address owner);

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the address provided by the deployer as the initial owner.
     */
    constructor(address initialOwner) {
        if (initialOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(initialOwner);
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        if (owner() != _msgSender()) {
            revert OwnableUnauthorizedAccount(_msgSender());
        }
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby disabling any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        if (newOwner == address(0)) {
            revert OwnableInvalidOwner(address(0));
        }
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}
ERC20.sol 316 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)

pragma solidity ^0.8.20;

import {IERC20} from "./IERC20.sol";
import {IERC20Metadata} from "./extensions/IERC20Metadata.sol";
import {Context} from "../../utils/Context.sol";
import {IERC20Errors} from "../../interfaces/draft-IERC6093.sol";

/**
 * @dev Implementation of the {IERC20} interface.
 *
 * This implementation is agnostic to the way tokens are created. This means
 * that a supply mechanism has to be added in a derived contract using {_mint}.
 *
 * TIP: For a detailed writeup see our guide
 * https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
 * to implement supply mechanisms].
 *
 * The default value of {decimals} is 18. To change this, you should override
 * this function so it returns a different value.
 *
 * We have followed general OpenZeppelin Contracts guidelines: functions revert
 * instead returning `false` on failure. This behavior is nonetheless
 * conventional and does not conflict with the expectations of ERC20
 * applications.
 *
 * Additionally, an {Approval} event is emitted on calls to {transferFrom}.
 * This allows applications to reconstruct the allowance for all accounts just
 * by listening to said events. Other implementations of the EIP may not emit
 * these events, as it isn't required by the specification.
 */
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
    mapping(address account => uint256) private _balances;

    mapping(address account => mapping(address spender => uint256)) private _allowances;

    uint256 private _totalSupply;

    string private _name;
    string private _symbol;

    /**
     * @dev Sets the values for {name} and {symbol}.
     *
     * All two of these values are immutable: they can only be set once during
     * construction.
     */
    constructor(string memory name_, string memory symbol_) {
        _name = name_;
        _symbol = symbol_;
    }

    /**
     * @dev Returns the name of the token.
     */
    function name() public view virtual returns (string memory) {
        return _name;
    }

    /**
     * @dev Returns the symbol of the token, usually a shorter version of the
     * name.
     */
    function symbol() public view virtual returns (string memory) {
        return _symbol;
    }

    /**
     * @dev Returns the number of decimals used to get its user representation.
     * For example, if `decimals` equals `2`, a balance of `505` tokens should
     * be displayed to a user as `5.05` (`505 / 10 ** 2`).
     *
     * Tokens usually opt for a value of 18, imitating the relationship between
     * Ether and Wei. This is the default value returned by this function, unless
     * it's overridden.
     *
     * NOTE: This information is only used for _display_ purposes: it in
     * no way affects any of the arithmetic of the contract, including
     * {IERC20-balanceOf} and {IERC20-transfer}.
     */
    function decimals() public view virtual returns (uint8) {
        return 18;
    }

    /**
     * @dev See {IERC20-totalSupply}.
     */
    function totalSupply() public view virtual returns (uint256) {
        return _totalSupply;
    }

    /**
     * @dev See {IERC20-balanceOf}.
     */
    function balanceOf(address account) public view virtual returns (uint256) {
        return _balances[account];
    }

    /**
     * @dev See {IERC20-transfer}.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - the caller must have a balance of at least `value`.
     */
    function transfer(address to, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _transfer(owner, to, value);
        return true;
    }

    /**
     * @dev See {IERC20-allowance}.
     */
    function allowance(address owner, address spender) public view virtual returns (uint256) {
        return _allowances[owner][spender];
    }

    /**
     * @dev See {IERC20-approve}.
     *
     * NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
     * `transferFrom`. This is semantically equivalent to an infinite approval.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     */
    function approve(address spender, uint256 value) public virtual returns (bool) {
        address owner = _msgSender();
        _approve(owner, spender, value);
        return true;
    }

    /**
     * @dev See {IERC20-transferFrom}.
     *
     * Emits an {Approval} event indicating the updated allowance. This is not
     * required by the EIP. See the note at the beginning of {ERC20}.
     *
     * NOTE: Does not update the allowance if the current allowance
     * is the maximum `uint256`.
     *
     * Requirements:
     *
     * - `from` and `to` cannot be the zero address.
     * - `from` must have a balance of at least `value`.
     * - the caller must have allowance for ``from``'s tokens of at least
     * `value`.
     */
    function transferFrom(address from, address to, uint256 value) public virtual returns (bool) {
        address spender = _msgSender();
        _spendAllowance(from, spender, value);
        _transfer(from, to, value);
        return true;
    }

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to`.
     *
     * This internal function is equivalent to {transfer}, and can be used to
     * e.g. implement automatic token fees, slashing mechanisms, etc.
     *
     * Emits a {Transfer} event.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _transfer(address from, address to, uint256 value) internal {
        if (from == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        if (to == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(from, to, value);
    }

    /**
     * @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
     * (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
     * this function.
     *
     * Emits a {Transfer} event.
     */
    function _update(address from, address to, uint256 value) internal virtual {
        if (from == address(0)) {
            // Overflow check required: The rest of the code assumes that totalSupply never overflows
            _totalSupply += value;
        } else {
            uint256 fromBalance = _balances[from];
            if (fromBalance < value) {
                revert ERC20InsufficientBalance(from, fromBalance, value);
            }
            unchecked {
                // Overflow not possible: value <= fromBalance <= totalSupply.
                _balances[from] = fromBalance - value;
            }
        }

        if (to == address(0)) {
            unchecked {
                // Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
                _totalSupply -= value;
            }
        } else {
            unchecked {
                // Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
                _balances[to] += value;
            }
        }

        emit Transfer(from, to, value);
    }

    /**
     * @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
     * Relies on the `_update` mechanism
     *
     * Emits a {Transfer} event with `from` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead.
     */
    function _mint(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidReceiver(address(0));
        }
        _update(address(0), account, value);
    }

    /**
     * @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
     * Relies on the `_update` mechanism.
     *
     * Emits a {Transfer} event with `to` set to the zero address.
     *
     * NOTE: This function is not virtual, {_update} should be overridden instead
     */
    function _burn(address account, uint256 value) internal {
        if (account == address(0)) {
            revert ERC20InvalidSender(address(0));
        }
        _update(account, address(0), value);
    }

    /**
     * @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
     *
     * This internal function is equivalent to `approve`, and can be used to
     * e.g. set automatic allowances for certain subsystems, etc.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `owner` cannot be the zero address.
     * - `spender` cannot be the zero address.
     *
     * Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
     */
    function _approve(address owner, address spender, uint256 value) internal {
        _approve(owner, spender, value, true);
    }

    /**
     * @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
     *
     * By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
     * `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
     * `Approval` event during `transferFrom` operations.
     *
     * Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
     * true using the following override:
     * ```
     * function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
     *     super._approve(owner, spender, value, true);
     * }
     * ```
     *
     * Requirements are the same as {_approve}.
     */
    function _approve(address owner, address spender, uint256 value, bool emitEvent) internal virtual {
        if (owner == address(0)) {
            revert ERC20InvalidApprover(address(0));
        }
        if (spender == address(0)) {
            revert ERC20InvalidSpender(address(0));
        }
        _allowances[owner][spender] = value;
        if (emitEvent) {
            emit Approval(owner, spender, value);
        }
    }

    /**
     * @dev Updates `owner` s allowance for `spender` based on spent `value`.
     *
     * Does not update the allowance value in case of infinite allowance.
     * Revert if not enough allowance is available.
     *
     * Does not emit an {Approval} event.
     */
    function _spendAllowance(address owner, address spender, uint256 value) internal virtual {
        uint256 currentAllowance = allowance(owner, spender);
        if (currentAllowance != type(uint256).max) {
            if (currentAllowance < value) {
                revert ERC20InsufficientAllowance(spender, currentAllowance, value);
            }
            unchecked {
                _approve(owner, spender, currentAllowance - value, 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);
}
draft-IERC6093.sol 161 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
IERC20Metadata.sol 26 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)

pragma solidity ^0.8.20;

import {IERC20} from "../IERC20.sol";

/**
 * @dev Interface for the optional metadata functions from the ERC20 standard.
 */
interface IERC20Metadata is IERC20 {
    /**
     * @dev Returns the name of the token.
     */
    function name() external view returns (string memory);

    /**
     * @dev Returns the symbol of the token.
     */
    function symbol() external view returns (string memory);

    /**
     * @dev Returns the decimals places of the token.
     */
    function decimals() external view returns (uint8);
}

Read Contract

LOCK_DURATION 0x485d3834 → uint256
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
barkcoinContorl 0x03386e70 → address
decimals 0x313ce567 → uint8
getAvailableBalance 0x6c24a76f → uint256
getBurnRate 0x482cd6c5 → uint8
getExchangeBalance 0x9c4ad6d4 → uint256
getExchangeIndex 0x5d1751be → uint256
getExchangeLock 0xff267860 → tuple
getExchangeLockLength 0x86cf0862 → uint256
getLockUntilBlock 0xd2dfd135 → uint256
isWhitelisted 0x3af32abf → bool
name 0x06fdde03 → string
owner 0x8da5cb5b → address
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256

Write Contract 11 functions

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

approve 0x095ea7b3
address spender
uint256 value
returns: bool
exchangeTransfer 0xd9ddafb3
address recipient
uint256 amount
lockAddresses 0xba1160eb
address[] accounts
uint256 unlockBlock
renounceOwnership 0x715018a6
No parameters
setBurnRate 0x5eb08d8a
uint8 burnRate
setControl 0x5ac8260c
address control
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
unlockAddresses 0xa501242f
address[] accounts
whitelistAddress 0xb9a45aac
address account
bool state

Recent Transactions

CSV View All 19 Transactions →
|
Hash Method Block Age From/To Value Txn Fee Type
0xfcbc7416...65c5a2 approve 24,460,041 IN 0x3bC0A634...17af 0 ETH 0.000003883585 ETH EIP-1559
0xf320119a...c32843 approve 24,323,619 IN 0x41096366...9646 0 ETH 0.000002268958 ETH Legacy
0x43476384...6f82de approve 24,320,240 IN 0xA44D9607...8B78 0 ETH 0.000011925939 ETH Legacy
0xb7a34d73...5b8703 transfer 24,319,735 IN 0x3ed4Fd91...66A4 0 ETH 0.000019606298 ETH Legacy
0x50a1c6f6...187620 approve 24,308,442 IN 0xF72F1Db8...E11c 0 ETH 0.000001858881 ETH Legacy
0xa307d040...bf62d0 approve 24,308,438 IN 0xF72F1Db8...E11c 0 ETH 0.000001943502 ETH Legacy
0x96512455...7d1be8 transfer 24,293,842 IN 0x3a74fcC3...9F5a 0 ETH 0.000001861964 ETH Legacy
0x0df435a2...3a0348 transfer 24,293,146 IN 0xD050D90b...e63E 0 ETH 0.000002121309 ETH Legacy
0x61328a43...4a11f2 transfer 24,293,100 IN 0xD050D90b...e63E 0 ETH 0.000003263278 ETH Legacy
0xb61e91ae...7ee615 transfer 24,293,082 IN 0xD050D90b...e63E 0 ETH 0.000002345411 ETH Legacy