Address Contract Partially Verified
Address
0x196a26eF25Beea61f9199e3F9d4C5C03377DF786
Balance
0 ETH
Nonce
1
Code Size
11091 bytes
Creator
0xA05C03Cb...AaF1 at tx 0xdf57e7e0...2dd0a5
Indexed Transactions
0
Contract Bytecode
11091 bytes
0x608060405234801561001057600080fd5b50600436106101cf5760003560e01c8063718da7ee116101045780639e2c8a5b116100a2578063d321fe2911610071578063d321fe2914610568578063e3f56eaa14610586578063ec95c4c9146105b6578063ed87169c146105e6576101cf565b80639e2c8a5b146104e25780639fe32732146104fe578063b6db75a01461051a578063cd401c1d14610538576101cf565b80638610d094116100de5780638610d0941461045a578063874dae881461048a5780638f32d59b146104a657806398aca922146104c4576101cf565b8063718da7ee146103f25780637b0472f01461040e57806384c6fbba1461042a576101cf565b80634fb2e45d11610171578063584b62a11161014b578063584b62a11461034457806359f7cf50146103745780635bb5d121146103a45780636b701c95146103c2576101cf565b80634fb2e45d146102ee57806350e59eb31461030a57806355d95e0b14610328576101cf565b80632045d91f116101ad5780632045d91f146102405780632db78d931461027057806334c5a044146102a057806343352d61146102d0576101cf565b80630b5f0f1f146101d45780631319649d146101f25780631643c7f514610210575b600080fd5b6101dc610616565b6040516101e99190611f38565b60405180910390f35b6101fa610631565b6040516102079190611f38565b60405180910390f35b61022a60048036038101906102259190611ff1565b61063e565b60405161023791906120ef565b60405180910390f35b61025a60048036038101906102559190612111565b610724565b60405161026791906120ef565b60405180910390f35b61028a60048036038101906102859190612151565b610861565b6040516102979190611f38565b60405180910390f35b6102ba60048036038101906102b59190612151565b610879565b6040516102c79190611f38565b60405180910390f35b6102d86108c2565b6040516102e5919061223c565b60405180910390f35b61030860048036038101906103039190612151565b610950565b005b610312610a71565b60405161031f9190612279565b60405180910390f35b610342600480360381019061033d9190612151565b610ad1565b005b61035e60048036038101906103599190611ff1565b610b5c565b60405161036b9190611f38565b60405180910390f35b61038e60048036038101906103899190612294565b610b81565b60405161039b91906123f2565b60405180910390f35b6103ac610d51565b6040516103b99190612423565b60405180910390f35b6103dc60048036038101906103d79190612597565b610d7b565b6040516103e991906123f2565b60405180910390f35b61040c60048036038101906104079190612631565b610f20565b005b61042860048036038101906104239190612111565b610fab565b005b610444600480360381019061043f9190612294565b6113a3565b60405161045191906120ef565b60405180910390f35b610474600480360381019061046f9190612111565b61144b565b604051610481919061223c565b60405180910390f35b6104a4600480360381019061049f9190611ff1565b611566565b005b6104ae611643565b6040516104bb9190612279565b60405180910390f35b6104cc6116a1565b6040516104d99190612423565b60405180910390f35b6104fc60048036038101906104f79190612111565b6116cb565b005b6105186004803603810190610513919061269c565b611a53565b005b610522611ade565b60405161052f9190612279565b60405180910390f35b610552600480360381019061054d91906126c9565b611b2e565b60405161055f91906123f2565b60405180910390f35b610570611d1a565b60405161057d91906120ef565b60405180910390f35b6105a0600480360381019061059b9190612151565b611e45565b6040516105ad9190611f38565b60405180910390f35b6105d060048036038101906105cb9190612294565b611e9f565b6040516105dd9190611f38565b60405180910390f35b61060060048036038101906105fb9190611ff1565b611ebc565b60405161060d9190611f38565b60405180910390f35b60006006600080815260200190815260200160002054905090565b6000600580549050905090565b606060008267ffffffffffffffff81111561065c5761065b612454565b5b60405190808252806020026020018201604052801561068a5781602001602082028036833780820191505090505b50905060005b8381101561071957600760008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000828152602001908152602001600020548282815181106106fc576106fb61271c565b5b602002602001018181525050806107129061277a565b9050610690565b508091505092915050565b60606000838361073491906127c3565b67ffffffffffffffff81111561074d5761074c612454565b5b60405190808252806020026020018201604052801561077b5781602001602082028036833780820191505090505b50905060008490505b838110156108565760076000600583815481106107a4576107a361271c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008081526020019081526020016000205482868361082891906127c3565b815181106108395761083861271c565b5b6020026020010181815250508061084f9061277a565b9050610784565b508091505092915050565b60086020528060005260406000206000915090505481565b6000600160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6060600580548060200260200160405190810160405280929190818152602001828054801561094657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116108fc575b5050505050905090565b610958611643565b610997576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161098e9061287a565b60405180910390fd5b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690506109c8826001611566565b6109d3816000611566565b816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8934ce4adea8d9ce0d714d2c22b86790e41b7731c84b926fbbdc1d40ff6533c960405160405180910390a35050565b6000610a7b611643565b80610acc5750600b60016000610a8f611f17565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054145b905090565b610ad9611643565b610b18576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b0f9061287a565b60405180910390fd5b80600360006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b6007602052816000526040600020602052806000526040600020600091509150505481565b6060600060058054905067ffffffffffffffff811115610ba457610ba3612454565b5b604051908082528060200260200182016040528015610bd757816020015b6060815260200190600190039081610bc25790505b50905060005b600580549050811015610d47578367ffffffffffffffff811115610c0457610c03612454565b5b604051908082528060200260200182016040528015610c325781602001602082028036833780820191505090505b50828281518110610c4657610c4561271c565b5b602002602001018190525060005b84811015610d35576007600060058481548110610c7457610c7361271c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082815260200190815260200160002054838381518110610cfe57610cfd61271c565b5b60200260200101518281518110610d1857610d1761271c565b5b60200260200101818152505080610d2e9061277a565b9050610c54565b5080610d409061277a565b9050610bdd565b5080915050919050565b6000600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606000825167ffffffffffffffff811115610d9a57610d99612454565b5b604051908082528060200260200182016040528015610dcd57816020015b6060815260200190600190039081610db85790505b50905060005b8351811015610f15578467ffffffffffffffff811115610df657610df5612454565b5b604051908082528060200260200182016040528015610e245781602001602082028036833780820191505090505b50828281518110610e3857610e3761271c565b5b602002602001018190525060005b85811015610f035760076000868481518110610e6557610e6461271c565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082815260200190815260200160002054838381518110610ecc57610ecb61271c565b5b60200260200101518281518110610ee657610ee561271c565b5b60200260200101818152505080610efc9061277a565b9050610e46565b5080610f0e9061277a565b9050610dd3565b508091505092915050565b610f28611643565b610f67576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f5e9061287a565b60405180910390fd5b80600260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60008211610fee576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610fe5906128e6565b60405180910390fd5b60008111611031576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161102890612952565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632c54de4f600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1661109a611f17565b600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16856040518563ffffffff1660e01b81526004016110dd94939291906129d1565b600060405180830381600087803b1580156110f757600080fd5b505af115801561110b573d6000803e3d6000fd5b50505050806006600084815260200190815260200160002060008282546111329190612a16565b925050819055508060066000808152602001908152602001600020600082825461115c9190612a16565b925050819055508060076000611170611f17565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060008282546111ca9190612a16565b9250508190555080600760006111de611f17565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080815260200190815260200160002060008282546112389190612a16565b9250508190555060006008600061124d611f17565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020541415611349576005611298611f17565b9080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506005805490506008600061130a611f17565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055505b81611352611f17565b73ffffffffffffffffffffffffffffffffffffffff167f5af417134f72a9d41143ace85b0a26dce6f550f894f2cbc1eeee8810603d91b6836040516113979190611f38565b60405180910390a35050565b606060008267ffffffffffffffff8111156113c1576113c0612454565b5b6040519080825280602002602001820160405280156113ef5781602001602082028036833780820191505090505b50905060005b838110156114415760066000828152602001908152602001600020548282815181106114245761142361271c565b5b6020026020010181815250508061143a9061277a565b90506113f5565b5080915050919050565b60606000838361145b91906127c3565b67ffffffffffffffff81111561147457611473612454565b5b6040519080825280602002602001820160405280156114a25781602001602082028036833780820191505090505b50905060008490505b8381101561155b57600581815481106114c7576114c661271c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff168286836114ff91906127c3565b815181106115105761150f61271c565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050806115549061277a565b90506114ab565b508091505092915050565b61156e611643565b6115ad576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115a49061287a565b60405180910390fd5b80600160008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff167f65efeaf737ce094d287661b6a56bb530dce1fc30853708d1912a74f8ae65ffbb826040516116379190611f38565b60405180910390a25050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16611685611f17565b73ffffffffffffffffffffffffffffffffffffffff1614905090565b6000600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b6000821161170e576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611705906128e6565b60405180910390fd5b60008111611751576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161174890612952565b60405180910390fd5b806007600061175e611f17565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000205410156117eb576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016117e290612ab8565b60405180910390fd5b600460009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632c54de4f600360009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16600260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16611877611f17565b856040518563ffffffff1660e01b81526004016118979493929190612ad8565b600060405180830381600087803b1580156118b157600080fd5b505af11580156118c5573d6000803e3d6000fd5b50505050806006600084815260200190815260200160002060008282546118ec91906127c3565b925050819055508060066000808152602001908152602001600020600082825461191691906127c3565b92505081905550806007600061192a611f17565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000848152602001908152602001600020600082825461198491906127c3565b925050819055508060076000611998611f17565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080815260200190815260200160002060008282546119f291906127c3565b9250508190555081611a02611f17565b73ffffffffffffffffffffffffffffffffffffffff167ff960dbf9e5d0682f7a298ed974e33a28b4464914b7a2bfac12ae419a9afeb28083604051611a479190611f38565b60405180910390a35050565b611a5b611643565b611a9a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a919061287a565b60405180910390fd5b80600460006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b60006001806000611aed611f17565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205414905090565b606060008383611b3e91906127c3565b67ffffffffffffffff811115611b5757611b56612454565b5b604051908082528060200260200182016040528015611b8a57816020015b6060815260200190600190039081611b755790505b50905060008490505b83811015611d0e578567ffffffffffffffff811115611bb557611bb4612454565b5b604051908082528060200260200182016040528015611be35781602001602082028036833780820191505090505b50828683611bf191906127c3565b81518110611c0257611c0161271c565b5b602002602001018190525060005b86811015611cfc576007600060058481548110611c3057611c2f61271c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600082815260200190815260200160002054838784611cb491906127c3565b81518110611cc557611cc461271c565b5b60200260200101518281518110611cdf57611cde61271c565b5b60200260200101818152505080611cf59061277a565b9050611c10565b5080611d079061277a565b9050611b93565b50809150509392505050565b6060600060058054905067ffffffffffffffff811115611d3d57611d3c612454565b5b604051908082528060200260200182016040528015611d6b5781602001602082028036833780820191505090505b50905060005b600580549050811015611e3d576007600060058381548110611d9657611d9561271c565b5b9060005260206000200160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600080815260200190815260200160002054828281518110611e2057611e1f61271c565b5b60200260200101818152505080611e369061277a565b9050611d71565b508091505090565b6000600760008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000206000808152602001908152602001600020549050919050565b600060066000838152602001908152602001600020549050919050565b6000600760008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020600083815260200190815260200160002054905092915050565b600033905090565b6000819050919050565b611f3281611f1f565b82525050565b6000602082019050611f4d6000830184611f29565b92915050565b6000604051905090565b600080fd5b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611f9282611f67565b9050919050565b611fa281611f87565b8114611fad57600080fd5b50565b600081359050611fbf81611f99565b92915050565b611fce81611f1f565b8114611fd957600080fd5b50565b600081359050611feb81611fc5565b92915050565b6000806040838503121561200857612007611f5d565b5b600061201685828601611fb0565b925050602061202785828601611fdc565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61206681611f1f565b82525050565b6000612078838361205d565b60208301905092915050565b6000602082019050919050565b600061209c82612031565b6120a6818561203c565b93506120b18361204d565b8060005b838110156120e25781516120c9888261206c565b97506120d483612084565b9250506001810190506120b5565b5085935050505092915050565b600060208201905081810360008301526121098184612091565b905092915050565b6000806040838503121561212857612127611f5d565b5b600061213685828601611fdc565b925050602061214785828601611fdc565b9150509250929050565b60006020828403121561216757612166611f5d565b5b600061217584828501611fb0565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b6121b381611f87565b82525050565b60006121c583836121aa565b60208301905092915050565b6000602082019050919050565b60006121e98261217e565b6121f38185612189565b93506121fe8361219a565b8060005b8381101561222f57815161221688826121b9565b9750612221836121d1565b925050600181019050612202565b5085935050505092915050565b6000602082019050818103600083015261225681846121de565b905092915050565b60008115159050919050565b6122738161225e565b82525050565b600060208201905061228e600083018461226a565b92915050565b6000602082840312156122aa576122a9611f5d565b5b60006122b884828501611fdc565b91505092915050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b600082825260208201905092915050565b600061230982612031565b61231381856122ed565b935061231e8361204d565b8060005b8381101561234f578151612336888261206c565b975061234183612084565b925050600181019050612322565b5085935050505092915050565b600061236883836122fe565b905092915050565b6000602082019050919050565b6000612388826122c1565b61239281856122cc565b9350836020820285016123a4856122dd565b8060005b858110156123e057848403895281516123c1858261235c565b94506123cc83612370565b925060208a019950506001810190506123a8565b50829750879550505050505092915050565b6000602082019050818103600083015261240c818461237d565b905092915050565b61241d81611f87565b82525050565b60006020820190506124386000830184612414565b92915050565b600080fd5b6000601f19601f8301169050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b61248c82612443565b810181811067ffffffffffffffff821117156124ab576124aa612454565b5b80604052505050565b60006124be611f53565b90506124ca8282612483565b919050565b600067ffffffffffffffff8211156124ea576124e9612454565b5b602082029050602081019050919050565b600080fd5b600061251361250e846124cf565b6124b4565b90508083825260208201905060208402830185811115612536576125356124fb565b5b835b8181101561255f578061254b8882611fb0565b845260208401935050602081019050612538565b5050509392505050565b600082601f83011261257e5761257d61243e565b5b813561258e848260208601612500565b91505092915050565b600080604083850312156125ae576125ad611f5d565b5b60006125bc85828601611fdc565b925050602083013567ffffffffffffffff8111156125dd576125dc611f62565b5b6125e985828601612569565b9150509250929050565b60006125fe82611f67565b9050919050565b61260e816125f3565b811461261957600080fd5b50565b60008135905061262b81612605565b92915050565b60006020828403121561264757612646611f5d565b5b60006126558482850161261c565b91505092915050565b600061266982611f87565b9050919050565b6126798161265e565b811461268457600080fd5b50565b60008135905061269681612670565b92915050565b6000602082840312156126b2576126b1611f5d565b5b60006126c084828501612687565b91505092915050565b6000806000606084860312156126e2576126e1611f5d565b5b60006126f086828701611fdc565b935050602061270186828701611fdc565b925050604061271286828701611fdc565b9150509250925092565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b600061278582611f1f565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156127b8576127b761274b565b5b600182019050919050565b60006127ce82611f1f565b91506127d983611f1f565b9250828210156127ec576127eb61274b565b5b828203905092915050565b600082825260208201905092915050565b7f4d656d62657273686970203a2063616c6c6572206973206e6f7420746865206f60008201527f776e657200000000000000000000000000000000000000000000000000000000602082015250565b60006128646024836127f7565b915061286f82612808565b604082019050919050565b6000602082019050818103600083015261289381612857565b9050919050565b7f496e76616c696420696e64657800000000000000000000000000000000000000600082015250565b60006128d0600d836127f7565b91506128db8261289a565b602082019050919050565b600060208201905081810360008301526128ff816128c3565b9050919050565b7f496e76616c696420616d6f756e74000000000000000000000000000000000000600082015250565b600061293c600e836127f7565b915061294782612906565b602082019050919050565b6000602082019050818103600083015261296b8161292f565b9050919050565b6000819050919050565b600061299761299261298d84611f67565b612972565b611f67565b9050919050565b60006129a98261297c565b9050919050565b60006129bb8261299e565b9050919050565b6129cb816129b0565b82525050565b60006080820190506129e66000830187612414565b6129f36020830186612414565b612a0060408301856129c2565b612a0d6060830184611f29565b95945050505050565b6000612a2182611f1f565b9150612a2c83611f1f565b9250827fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff03821115612a6157612a6061274b565b5b828201905092915050565b7f496e73756666696369656e742062616c616e6365000000000000000000000000600082015250565b6000612aa26014836127f7565b9150612aad82612a6c565b602082019050919050565b60006020820190508181036000830152612ad181612a95565b9050919050565b6000608082019050612aed6000830187612414565b612afa60208301866129c2565b612b076040830185612414565b612b146060830184611f29565b9594505050505056fea2646970667358221220d16bd7c7279aa7805b0e742c2ac770085d319cdaabeb0204513e546f7de3997f64736f6c634300080a0033
Verified Source Code Partial Match
Compiler: v0.8.10+commit.fc410830
EVM: london
Optimization: No
LOKAStaking.sol 477 lines
pragma solidity ^0.8.0;
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)
/**
* @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 amount of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the amount of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);
/**
* @dev Moves `amount` tokens from `from` to `to` using the
* allowance mechanism. `amount` 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 amount
) external returns (bool);
}
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
/**
* @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;
}
}
contract Membership is Context {
address private owner;
event MembershipChanged(address indexed owner, uint256 level);
event OwnerTransferred(address indexed preOwner, address indexed newOwner);
mapping(address => uint256) internal membership;
constructor() {
owner = _msgSender();
setMembership(_msgSender(), 1);
}
function transferOwner(address newOwner) public onlyOwner {
address preOwner = owner;
setMembership(newOwner, 1);
setMembership(preOwner, 0);
owner = newOwner;
emit OwnerTransferred(preOwner, newOwner);
}
function setMembership(address key, uint256 level) public onlyOwner {
membership[key] = level;
emit MembershipChanged(key, level);
}
modifier onlyOwner() {
require(isOwner(), "Membership : caller is not the owner");
_;
}
function isOwner() public view returns (bool) {
return _msgSender() == owner;
}
modifier onlyAdmin() {
require(isAdmin(), "Membership : caller is not a admin");
_;
}
function isAdmin() public view returns (bool) {
return membership[_msgSender()] == 1;
}
modifier onlyMinter() {
require(isMinter(), "Memberhsip : caller is not a Minter");
_;
}
function isMinter() public view returns (bool) {
return isOwner() || membership[_msgSender()] == 11;
}
function getMembership(address account) public view returns (uint256){
return membership[account];
}
}
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)
/**
* @dev Interface of the ERC165 standard, as defined in the
* https://eips.ethereum.org/EIPS/eip-165[EIP].
*
* Implementers can declare support of contract interfaces, which can then be
* queried by others ({ERC165Checker}).
*
* For an implementation, see {ERC165}.
*/
interface IERC165 {
/**
* @dev Returns true if this contract implements the interface defined by
* `interfaceId`. See the corresponding
* https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
* to learn more about how these ids are created.
*
* This function call must use less than 30 000 gas.
*/
function supportsInterface(bytes4 interfaceId) external view returns (bool);
}
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)
/**
* @dev Required interface of an ERC721 compliant contract.
*/
interface IERC721 is IERC165 {
/**
* @dev Emitted when `tokenId` token is transferred from `from` to `to`.
*/
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
*/
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
/**
* @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
*/
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
/**
* @dev Returns the number of tokens in ``owner``'s account.
*/
function balanceOf(address owner) external view returns (uint256 balance);
/**
* @dev Returns the owner of the `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function ownerOf(uint256 tokenId) external view returns (address owner);
/**
* @dev Safely transfers `tokenId` token from `from` to `to`.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId,
bytes calldata data
) external;
/**
* @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
* are aware of the ERC721 protocol to prevent tokens from being forever locked.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must exist and be owned by `from`.
* - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
* - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
*
* Emits a {Transfer} event.
*/
function safeTransferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Transfers `tokenId` token from `from` to `to`.
*
* WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `tokenId` token must be owned by `from`.
* - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
*
* Emits a {Transfer} event.
*/
function transferFrom(
address from,
address to,
uint256 tokenId
) external;
/**
* @dev Gives permission to `to` to transfer `tokenId` token to another account.
* The approval is cleared when the token is transferred.
*
* Only a single account can be approved at a time, so approving the zero address clears previous approvals.
*
* Requirements:
*
* - The caller must own the token or be an approved operator.
* - `tokenId` must exist.
*
* Emits an {Approval} event.
*/
function approve(address to, uint256 tokenId) external;
/**
* @dev Approve or remove `operator` as an operator for the caller.
* Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
*
* Requirements:
*
* - The `operator` cannot be the caller.
*
* Emits an {ApprovalForAll} event.
*/
function setApprovalForAll(address operator, bool _approved) external;
/**
* @dev Returns the account approved for `tokenId` token.
*
* Requirements:
*
* - `tokenId` must exist.
*/
function getApproved(uint256 tokenId) external view returns (address operator);
/**
* @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
*
* See {setApprovalForAll}
*/
function isApprovedForAll(address owner, address operator) external view returns (bool);
}
contract Transmitter is Membership {
function checkToken(address token, address payer, uint256 amount) public view {
require(IERC20(token).balanceOf(payer)>=amount, "Insufficient balance");
require(IERC20(token).allowance(payer, address(this))>=amount, "Not approved");
}
function checkNft(address nft, address owner, uint256 tokenId) public view {
require(IERC721(nft).ownerOf(tokenId) == owner, "Not owner");
require(IERC721(nft).isApprovedForAll(owner, address(this)), "Not approved");
}
function transferToken(address token, address payer, address receiver, uint256 amount) public onlyMinter{
IERC20(token).transferFrom(payer, receiver, amount);
}
function transferNft(address nft, address owner, address proposer, uint256 tokenId) public onlyMinter{
IERC721(nft).transferFrom(owner, proposer, tokenId);
}
}
contract LOKAStaking is Membership{
event Stake(address indexed from, uint256 indexed continent, uint256 amount);
event Unstake(address indexed from, uint256 indexed continent, uint256 amount);
address payable private receiver;
address LOKA;
Transmitter transmitter;
address[] internal stakers;
mapping(uint256 => uint256) private continents;
mapping(address => mapping (uint256 => uint256) ) public stakes;
mapping(address => uint256) public indexes;
constructor(address _loka, Transmitter _transmitter) {
setLoka(_loka);
setTransmitter(_transmitter);
setReceiver(payable(_msgSender()));
}
function setTransmitter(Transmitter _transmitter) public onlyOwner {
transmitter = _transmitter;
}
function setReceiver(address payable _receiver) public onlyOwner {
receiver = _receiver;
}
function setLoka(address _loka) public onlyOwner {
LOKA = _loka;
}
function getReceiver() public view returns(address) {
return receiver;
}
function getTransmitter() public view returns(address) {
return address(transmitter);
}
function getStakerCount() public view returns(uint256){
return stakers.length;
}
function getStakers() public view returns(address[] memory){
return stakers;
}
function getStakersRange(uint256 start, uint256 end) public view returns(address[] memory){
address[] memory addresses = new address[](end-start);
for(uint256 i=start; i<end; ++i){
addresses[i-start] = stakers[i];
}
return addresses;
}
function getAmount() public view returns(uint256[] memory){
uint256[] memory amounts = new uint256[](stakers.length);
for(uint256 i=0; i<stakers.length; ++i){
amounts[i] = stakes[stakers[i]][0];
}
return amounts;
}
function getAmountRange(uint256 start, uint256 end) public view returns(uint256[] memory){
uint256[] memory amounts = new uint256[](end-start);
for(uint256 i=start; i<end; ++i){
amounts[i-start] = stakes[stakers[i]][0];
}
return amounts;
}
function getAmounts(uint256 size) public view returns(uint256[][] memory){
uint256[][] memory amounts = new uint256[][](stakers.length);
for(uint256 i=0; i<stakers.length; ++i){
amounts[i] = new uint256[](size);
for(uint256 j=0; j<size; ++j)
amounts[i][j] = stakes[stakers[i]][j];
}
return amounts;
}
function getAmountsByAddress(uint256 size, address[] memory owners) public view returns(uint256[][] memory){
uint256[][] memory amounts = new uint256[][](owners.length);
for(uint256 i=0; i<owners.length; ++i){
amounts[i] = new uint256[](size);
for(uint256 j=0; j<size; ++j)
amounts[i][j] = stakes[owners[i]][j];
}
return amounts;
}
function getAmountsRange(uint256 size, uint256 start, uint256 end) public view returns(uint256[][] memory){
uint256[][] memory amounts = new uint256[][](end-start);
for(uint256 i=start; i<end; ++i){
amounts[i-start] = new uint256[](size);
for(uint256 j=0; j<size; ++j)
amounts[i-start][j] = stakes[stakers[i]][j];
}
return amounts;
}
function stake(uint256 continent, uint256 amount) public {
require(continent>0, "Invalid index");
require(amount>0, "Invalid amount");
transmitter.transferToken(LOKA, _msgSender(), receiver, amount);
continents[continent] += amount;
continents[0] += amount;
stakes[_msgSender()][continent] += amount;
stakes[_msgSender()][0] += amount;
if(indexes[_msgSender()]==0)
{
stakers.push(_msgSender());
indexes[_msgSender()] = stakers.length;
}
emit Stake(_msgSender(), continent, amount);
}
function unstake(uint256 continent, uint256 amount) public {
require(continent>0, "Invalid index");
require(amount>0, "Invalid amount");
require(stakes[_msgSender()][continent]>=amount, "Insufficient balance");
transmitter.transferToken(LOKA, receiver, _msgSender(), amount);
continents[continent] -= amount;
continents[0] -= amount;
stakes[_msgSender()][continent] -= amount;
stakes[_msgSender()][0] -= amount;
emit Unstake(_msgSender(), continent, amount);
}
function stakeOf(address owner, uint256 continent) public view returns(uint256) {
return stakes[owner][continent];
}
function totalStakeOf(address owner) public view returns(uint256) {
return stakes[owner][0];
}
function allStakeOf(address owner, uint256 size) public view returns(uint256[] memory) {
uint256[] memory all = new uint256[](size);
for(uint256 i=0; i<size; ++i)
all[i] = stakes[owner][i];
return all;
}
function stakeOfContinent(uint256 index) public view returns(uint256) {
return continents[index];
}
function totalStakeOfContinent() public view returns(uint256) {
return continents[0];
}
function allStakeOfContinent(uint256 size) public view returns(uint256[] memory) {
uint256[] memory all = new uint256[](size);
for(uint256 i=0; i<size; ++i)
all[i] = continents[i];
return all;
}
}
Read Contract
allStakeOf 0x1643c7f5 → uint256[]
allStakeOfContinent 0x84c6fbba → uint256[]
getAmount 0xd321fe29 → uint256[]
getAmountRange 0x2045d91f → uint256[]
getAmounts 0x59f7cf50 → uint256[][]
getAmountsByAddress 0x6b701c95 → uint256[][]
getAmountsRange 0xcd401c1d → uint256[][]
getMembership 0x34c5a044 → uint256
getReceiver 0x98aca922 → address
getStakerCount 0x1319649d → uint256
getStakers 0x43352d61 → address[]
getStakersRange 0x8610d094 → address[]
getTransmitter 0x5bb5d121 → address
indexes 0x2db78d93 → uint256
isAdmin 0xb6db75a0 → bool
isMinter 0x50e59eb3 → bool
isOwner 0x8f32d59b → bool
stakeOf 0xed87169c → uint256
stakeOfContinent 0xec95c4c9 → uint256
stakes 0x584b62a1 → uint256
totalStakeOf 0xe3f56eaa → uint256
totalStakeOfContinent 0x0b5f0f1f → uint256
Write Contract 7 functions
These functions modify contract state and require a wallet transaction to execute.
setLoka 0x55d95e0b
address _loka
setMembership 0x874dae88
address key
uint256 level
setReceiver 0x718da7ee
address _receiver
setTransmitter 0x9fe32732
address _transmitter
stake 0x7b0472f0
uint256 continent
uint256 amount
transferOwner 0x4fb2e45d
address newOwner
unstake 0x9e2c8a5b
uint256 continent
uint256 amount
Recent Transactions
No transactions found for this address