Address Contract Verified
Address
0xE44ac096D96b7918afc0d98cB18D40c5CA5868aB
Balance
0.069747 ETH
Nonce
1
Code Size
10958 bytes
Creator
0xd00fb280...0f2B at tx 0x581c17f5...fa2eef
Indexed Transactions
0
Contract Bytecode
10958 bytes
0x6080604052600436106101445760003560e01c80636fc61a09116100b6578063a8aa1b311161006f578063a8aa1b3114610431578063a9059cbb1461045c578063c0cbdea414610499578063d2d55dde146104c2578063dd62ed3e146104ff578063f2fde38b1461053c5761014b565b80636fc61a091461034757806370a082311461035e578063715018a61461039b5780638cd4426d146103b25780638da5cb5b146103db57806395d89b41146104065761014b565b806330488a551161010857806330488a5514610237578063313ce567146102625780633f4218e01461028d57806348ff2b8b146102ca5780635d098b38146102f35780635f7bcd701461031c5761014b565b806306fdde0314610150578063095ea7b31461017b57806318160ddd146101b857806320800a00146101e357806323b872dd146101fa5761014b565b3661014b57005b600080fd5b34801561015c57600080fd5b50610165610565565b6040516101729190611dc0565b60405180910390f35b34801561018757600080fd5b506101a2600480360381019061019d9190611e7b565b6105a2565b6040516101af9190611ed6565b60405180910390f35b3480156101c457600080fd5b506101cd6105b9565b6040516101da9190611f00565b60405180910390f35b3480156101ef57600080fd5b506101f86105c3565b005b34801561020657600080fd5b50610221600480360381019061021c9190611f1b565b610614565b60405161022e9190611ed6565b60405180910390f35b34801561024357600080fd5b5061024c6106df565b6040516102599190611f00565b60405180910390f35b34801561026e57600080fd5b506102776106e5565b6040516102849190611f8a565b60405180910390f35b34801561029957600080fd5b506102b460048036038101906102af9190611fa5565b6106ee565b6040516102c19190611ed6565b60405180910390f35b3480156102d657600080fd5b506102f160048036038101906102ec9190611ffe565b61070e565b005b3480156102ff57600080fd5b5061031a60048036038101906103159190611fa5565b610771565b005b34801561032857600080fd5b506103316107bd565b60405161033e919061204d565b60405180910390f35b34801561035357600080fd5b5061035c6107e3565b005b34801561036a57600080fd5b5061038560048036038101906103809190611fa5565b61086c565b6040516103929190611f00565b60405180910390f35b3480156103a757600080fd5b506103b06108b5565b005b3480156103be57600080fd5b506103d960048036038101906103d49190611e7b565b6108c9565b005b3480156103e757600080fd5b506103f0610954565b6040516103fd919061204d565b60405180910390f35b34801561041257600080fd5b5061041b61097d565b6040516104289190611dc0565b60405180910390f35b34801561043d57600080fd5b506104466109ba565b604051610453919061204d565b60405180910390f35b34801561046857600080fd5b50610483600480360381019061047e9190611e7b565b6109e0565b6040516104909190611ed6565b60405180910390f35b3480156104a557600080fd5b506104c060048036038101906104bb9190612068565b6109f7565b005b3480156104ce57600080fd5b506104e960048036038101906104e491906120bb565b610ab9565b6040516104f69190611f00565b60405180910390f35b34801561050b57600080fd5b50610526600480360381019061052191906120bb565b610d04565b6040516105339190611f00565b60405180910390f35b34801561054857600080fd5b50610563600480360381019061055e9190611fa5565b610d8b565b005b60606040518060400160405280600881526020017f4f736d6f20426f74000000000000000000000000000000000000000000000000815250905090565b60006105af338484610e0e565b6001905092915050565b6000600554905090565b6105cb610fd7565b3373ffffffffffffffffffffffffffffffffffffffff166108fc479081150290604051600060405180830381858888f19350505050158015610611573d6000803e3d6000fd5b50565b6000610621848484611055565b6106d484336106cf85604051806060016040528060288152602001612a7160289139600360008b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020546112389092919063ffffffff16565b610e0e565b600190509392505050565b600d5481565b60006012905090565b60046020528060005260406000206000915054906101000a900460ff1681565b610716610fd7565b80600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055505050565b610779610fd7565b80601260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555050565b601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b6107eb610fd7565b601160009054906101000a900460ff161561083b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161083290612147565b60405180910390fd5b6001601160006101000a81548160ff021916908315150217905550600754436108649190612196565b600681905550565b6000600260008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020549050919050565b6108bd610fd7565b6108c7600061128d565b565b6108d1610fd7565b8173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb33836040518363ffffffff1660e01b815260040161090c9291906121ca565b6020604051808303816000875af115801561092b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094f9190612208565b505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b60606040518060400160405280600481526020017f4f534d4f00000000000000000000000000000000000000000000000000000000815250905090565b601160039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b60006109ed338484611055565b6001905092915050565b6109ff610fd7565b826008819055508160098190555080600b81905550610a2a6005600c5461135190919063ffffffff16565b60085411158015610a525750610a4c6008600c5461135190919063ffffffff16565b60095411155b8015610a755750610a6f6008600c5461135190919063ffffffff16565b600b5411155b610ab4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610aab906122a7565b60405180910390fd5b505050565b60004360065410610c3957601160039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610b7c5760095461271060075461271043600654610b3391906122c7565b610b3d91906122fb565b610b47919061236c565b600954600a54610b5791906122c7565b610b6191906122fb565b610b6b919061236c565b610b759190612196565b9050610cfe565b601160039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610c345760085461271060075461271043600654610beb91906122c7565b610bf591906122fb565b610bff919061236c565b600854600a54610c0f91906122c7565b610c1991906122fb565b610c23919061236c565b610c2d9190612196565b9050610cfe565b610cf8565b601160039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610c98576009549050610cfe565b601160039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610cf7576008549050610cfe565b5b600b5490505b92915050565b6000600360008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002054905092915050565b610d93610fd7565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610e02576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610df99061240f565b60405180910390fd5b610e0b8161128d565b50565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603610e7d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e74906124a1565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603610eec576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610ee390612533565b60405180910390fd5b80600360008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92583604051610fca9190611f00565b60405180910390a3505050565b610fdf611367565b73ffffffffffffffffffffffffffffffffffffffff16610ffd610954565b73ffffffffffffffffffffffffffffffffffffffff1614611053576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161104a9061259f565b60405180910390fd5b565b61106083838361136f565b61106a83836114e0565b61107483836115dd565b61107f8383836116a8565b6110d181600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461171c90919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000208190555060006111208484611732565b61112a5781611136565b6111358484846117e0565b5b905061118a81600260008673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461194790919063ffffffff16565b600260008573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055508273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161122a9190611f00565b60405180910390a350505050565b6000838311158290611280576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112779190611dc0565b60405180910390fd5b5082840390509392505050565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6000818361135f919061236c565b905092915050565b600033905090565b600073ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff16036113de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016113d590612631565b60405180910390fd5b600073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff160361144d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611444906126c3565b60405180910390fd5b60008111611490576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161148790612755565b60405180910390fd5b6114998361086c565b8111156114db576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016114d2906127e7565b60405180910390fd5b505050565b600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156115845750600460008273ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156115d957601160009054906101000a900460ff166115d8576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016115cf90612853565b60405180910390fd5b5b5050565b601160039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161480156116845750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b156116a4576001600d600082825461169c9190612196565b925050819055505b5050565b6116b383838361195d565b156117175760006116c33061086c565b9050606460016005546116d691906122fb565b6116e0919061236c565b811061170457606460016005546116f791906122fb565b611701919061236c565b90505b61170d81611a7f565b6000600d81905550505b505050565b6000818361172a91906122c7565b905092915050565b6000600460008473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff161580156117d85750600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b905092915050565b6000806117ed8585610ab9565b111561193c5760006118256118028686610ab9565b611817600c548661135190919063ffffffff16565b611d1a90919063ffffffff16565b905061187981600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020016000205461194790919063ffffffff16565b600260003073ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001908152602001600020819055503073ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef836040516119199190611f00565b60405180910390a3611934818461171c90919063ffffffff16565b915050611940565b8190505b9392505050565b600081836119559190612196565b905092915050565b60008060105483101590506000600f546119763061086c565b10159050601160029054906101000a900460ff161580156119a35750601160019054906101000a900460ff165b80156119ac5750815b8015611a025750600460008773ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16155b8015611a5b5750601160039054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168573ffffffffffffffffffffffffffffffffffffffff16145b8015611a6b5750600e54600d5410155b8015611a745750805b925050509392505050565b6001601160026101000a81548160ff0219169083151502179055506000600267ffffffffffffffff811115611ab757611ab6612873565b5b604051908082528060200260200182016040528015611ae55781602001602082028036833780820191505090505b5090503081600081518110611afd57611afc6128a2565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ba4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bc891906128e6565b81600181518110611bdc57611bdb6128a2565b5b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff1681525050611c4330600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1684610e0e565b600160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663791ac94783600084601260009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16426040518663ffffffff1660e01b8152600401611cc9959493929190612a16565b600060405180830381600087803b158015611ce357600080fd5b505af1158015611cf7573d6000803e3d6000fd5b50505050506000601160026101000a81548160ff02191690831515021790555050565b60008183611d2891906122fb565b905092915050565b600081519050919050565b600082825260208201905092915050565b60005b83811015611d6a578082015181840152602081019050611d4f565b60008484015250505050565b6000601f19601f8301169050919050565b6000611d9282611d30565b611d9c8185611d3b565b9350611dac818560208601611d4c565b611db581611d76565b840191505092915050565b60006020820190508181036000830152611dda8184611d87565b905092915050565b600080fd5b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000611e1282611de7565b9050919050565b611e2281611e07565b8114611e2d57600080fd5b50565b600081359050611e3f81611e19565b92915050565b6000819050919050565b611e5881611e45565b8114611e6357600080fd5b50565b600081359050611e7581611e4f565b92915050565b60008060408385031215611e9257611e91611de2565b5b6000611ea085828601611e30565b9250506020611eb185828601611e66565b9150509250929050565b60008115159050919050565b611ed081611ebb565b82525050565b6000602082019050611eeb6000830184611ec7565b92915050565b611efa81611e45565b82525050565b6000602082019050611f156000830184611ef1565b92915050565b600080600060608486031215611f3457611f33611de2565b5b6000611f4286828701611e30565b9350506020611f5386828701611e30565b9250506040611f6486828701611e66565b9150509250925092565b600060ff82169050919050565b611f8481611f6e565b82525050565b6000602082019050611f9f6000830184611f7b565b92915050565b600060208284031215611fbb57611fba611de2565b5b6000611fc984828501611e30565b91505092915050565b611fdb81611ebb565b8114611fe657600080fd5b50565b600081359050611ff881611fd2565b92915050565b6000806040838503121561201557612014611de2565b5b600061202385828601611e30565b925050602061203485828601611fe9565b9150509250929050565b61204781611e07565b82525050565b6000602082019050612062600083018461203e565b92915050565b60008060006060848603121561208157612080611de2565b5b600061208f86828701611e66565b93505060206120a086828701611e66565b92505060406120b186828701611e66565b9150509250925092565b600080604083850312156120d2576120d1611de2565b5b60006120e085828601611e30565b92505060206120f185828601611e30565b9150509250929050565b7f54726164696e6720616c726561647920656e61626c6564000000000000000000600082015250565b6000612131601783611d3b565b915061213c826120fb565b602082019050919050565b6000602082019050818103600083015261216081612124565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006121a182611e45565b91506121ac83611e45565b92508282019050808211156121c4576121c3612167565b5b92915050565b60006040820190506121df600083018561203e565b6121ec6020830184611ef1565b9392505050565b60008151905061220281611fd2565b92915050565b60006020828403121561221e5761221d611de2565b5b600061222c848285016121f3565b91505092915050565b7f62757946656520616e642073656c6c4665652063616e6e6f74206265206d6f7260008201527f65207468616e2032302500000000000000000000000000000000000000000000602082015250565b6000612291602a83611d3b565b915061229c82612235565b604082019050919050565b600060208201905081810360008301526122c081612284565b9050919050565b60006122d282611e45565b91506122dd83611e45565b92508282039050818111156122f5576122f4612167565b5b92915050565b600061230682611e45565b915061231183611e45565b925082820261231f81611e45565b9150828204841483151761233657612335612167565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b600061237782611e45565b915061238283611e45565b9250826123925761239161233d565b5b828204905092915050565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b60006123f9602683611d3b565b91506124048261239d565b604082019050919050565b60006020820190508181036000830152612428816123ec565b9050919050565b7f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460008201527f7265737300000000000000000000000000000000000000000000000000000000602082015250565b600061248b602483611d3b565b91506124968261242f565b604082019050919050565b600060208201905081810360008301526124ba8161247e565b9050919050565b7f45524332303a20617070726f766520746f20746865207a65726f20616464726560008201527f7373000000000000000000000000000000000000000000000000000000000000602082015250565b600061251d602283611d3b565b9150612528826124c1565b604082019050919050565b6000602082019050818103600083015261254c81612510565b9050919050565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b6000612589602083611d3b565b915061259482612553565b602082019050919050565b600060208201905081810360008301526125b88161257c565b9050919050565b7f45524332303a207472616e736665722066726f6d20746865207a65726f20616460008201527f6472657373000000000000000000000000000000000000000000000000000000602082015250565b600061261b602583611d3b565b9150612626826125bf565b604082019050919050565b6000602082019050818103600083015261264a8161260e565b9050919050565b7f45524332303a207472616e7366657220746f20746865207a65726f206164647260008201527f6573730000000000000000000000000000000000000000000000000000000000602082015250565b60006126ad602383611d3b565b91506126b882612651565b604082019050919050565b600060208201905081810360008301526126dc816126a0565b9050919050565b7f5472616e7366657220616d6f756e74206d75737420626520677265617465722060008201527f7468616e207a65726f0000000000000000000000000000000000000000000000602082015250565b600061273f602983611d3b565b915061274a826126e3565b604082019050919050565b6000602082019050818103600083015261276e81612732565b9050919050565b7f596f752061726520747279696e6720746f207472616e73666572206d6f72652060008201527f7468616e20796f75722062616c616e6365000000000000000000000000000000602082015250565b60006127d1603183611d3b565b91506127dc82612775565b604082019050919050565b60006020820190508181036000830152612800816127c4565b9050919050565b7f45524332303a2054726164696e67206973206e6f7420616c6c6f776564000000600082015250565b600061283d601d83611d3b565b915061284882612807565b602082019050919050565b6000602082019050818103600083015261286c81612830565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000815190506128e081611e19565b92915050565b6000602082840312156128fc576128fb611de2565b5b600061290a848285016128d1565b91505092915050565b6000819050919050565b6000819050919050565b600061294261293d61293884612913565b61291d565b611e45565b9050919050565b61295281612927565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b61298d81611e07565b82525050565b600061299f8383612984565b60208301905092915050565b6000602082019050919050565b60006129c382612958565b6129cd8185612963565b93506129d883612974565b8060005b83811015612a095781516129f08882612993565b97506129fb836129ab565b9250506001810190506129dc565b5085935050505092915050565b600060a082019050612a2b6000830188611ef1565b612a386020830187612949565b8181036040830152612a4a81866129b8565b9050612a59606083018561203e565b612a666080830184611ef1565b969550505050505056fe45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365a2646970667358221220e5345a178579d53f815c61742a48da460c0fd950462224eb5053510ee5422d1764736f6c63430008120033
Verified Source Code Full Match
Compiler: v0.8.18+commit.87f61d96
EVM: paris
Optimization: No
OSMO.sol 436 lines
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.18;
library SafeMath {
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
function tryAdd(
uint256 a,
uint256 b
) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
function trySub(
uint256 a,
uint256 b
) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
function tryMul(
uint256 a,
uint256 b
) internal pure returns (bool, uint256) {
unchecked {
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
function tryDiv(
uint256 a,
uint256 b
) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
function tryMod(
uint256 a,
uint256 b
) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@uniswap/v2-core/contracts/interfaces/IUniswapV2Factory.sol";
import "@uniswap/v2-periphery/contracts/interfaces/IUniswapV2Router02.sol";
contract OSMO is IERC20, Ownable {
using SafeMath for uint256;
IUniswapV2Router02 router;
string private constant _name = "Osmo Bot";
string private constant _symbol = "OSMO";
mapping(address => uint256) _balances;
mapping(address => mapping(address => uint256)) private _allowances;
mapping(address => bool) public isFeeExempt;
uint8 private constant _decimals = 18;
uint256 private _totalSupply = 1_000_000 * (10 ** _decimals);
uint256 private init = 0;
uint256 private startEnd = 15;
uint256 private buyFee = 300;
uint256 private sellFee = 300;
uint256 private startFee = 3000;
uint256 private transferFee = 0;
uint256 private denominator = 10000;
uint256 public swapTimes = 0;
uint256 private swapCounter = 10;
uint256 private swapThreshold = (_totalSupply * 100) / 100000;
uint256 private _minTokenAmount = (_totalSupply * 1) / 100000;
bool private tradingOpen = false;
bool private swapEnabled = true;
bool private swapping;
address public pair;
address internal constant DEAD = 0x000000000000000000000000000000000000dEaD;
address public marketing_receiver;
modifier lockTheSwap() {
swapping = true;
_;
swapping = false;
}
constructor() Ownable() {
router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
pair = IUniswapV2Factory(router.factory()).createPair(
address(this),
router.WETH()
);
marketing_receiver = msg.sender;
isFeeExempt[address(this)] = true;
isFeeExempt[marketing_receiver] = true;
isFeeExempt[msg.sender] = true;
_balances[msg.sender] = _totalSupply;
emit Transfer(address(0), msg.sender, _totalSupply);
}
receive() external payable {}
function name() public pure returns (string memory) {
return _name;
}
function symbol() public pure returns (string memory) {
return _symbol;
}
function decimals() public pure returns (uint8) {
return _decimals;
}
function totalSupply() public view override returns (uint256) {
return _totalSupply;
}
function balanceOf(address account) public view override returns (uint256) {
return _balances[account];
}
function transfer(
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(msg.sender, recipient, amount);
return true;
}
function allowance(
address owner,
address spender
) public view override returns (uint256) {
return _allowances[owner][spender];
}
function isContract(address addr) internal view returns (bool) {
uint size;
assembly {
size := extcodesize(addr)
}
return size > 0;
}
function setisExempt(address _address, bool _enabled) external onlyOwner {
isFeeExempt[_address] = _enabled;
}
function approve(
address spender,
uint256 amount
) public override returns (bool) {
_approve(msg.sender, spender, amount);
return true;
}
function preTxCheck(
address sender,
address recipient,
uint256 amount
) internal view {
require(sender != address(0), "ERC20: transfer from the zero address");
require(recipient != address(0), "ERC20: transfer to the zero address");
require(
amount > uint256(0),
"Transfer amount must be greater than zero"
);
require(
amount <= balanceOf(sender),
"You are trying to transfer more than your balance"
);
}
function _transfer(
address sender,
address recipient,
uint256 amount
) private {
preTxCheck(sender, recipient, amount);
checkTradingAllowed(sender, recipient);
swapbackCounters(sender, recipient);
swapBack(sender, recipient, amount);
_balances[sender] = _balances[sender].sub(amount);
uint256 amountReceived = shouldTakeFee(sender, recipient)
? takeFee(sender, recipient, amount)
: amount;
_balances[recipient] = _balances[recipient].add(amountReceived);
emit Transfer(sender, recipient, amountReceived);
}
function setStructure(
uint256 _buy,
uint256 _sell,
uint256 _trans
) external onlyOwner {
buyFee = _buy;
sellFee = _sell;
transferFee = _trans;
require(
buyFee <= denominator.div(5) &&
sellFee <= denominator.div(8) &&
transferFee <= denominator.div(8),
"buyFee and sellFee cannot be more than 20%"
);
}
function swapbackCounters(address sender, address recipient) internal {
if (recipient == pair && !isFeeExempt[sender]) {
swapTimes += uint256(1);
}
}
function swapTokensForETH(uint256 tokenAmount) private lockTheSwap {
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = router.WETH();
_approve(address(this), address(router), tokenAmount);
router.swapExactTokensForETHSupportingFeeOnTransferTokens(
tokenAmount,
0,
path,
marketing_receiver,
block.timestamp
);
}
function max(uint256 a, uint256 b) internal pure returns (uint256) {
return a > b ? a : b;
}
function min(uint256 a, uint256 b) internal pure returns (uint256) {
return a < b ? a : b;
}
function shouldSwapBack(
address sender,
address recipient,
uint256 amount
) internal view returns (bool) {
bool aboveMin = amount >= _minTokenAmount;
bool aboveThreshold = balanceOf(address(this)) >= swapThreshold;
return
!swapping &&
swapEnabled &&
aboveMin &&
!isFeeExempt[sender] &&
recipient == pair &&
swapTimes >= uint256(swapCounter) &&
aboveThreshold;
}
function swapBack(
address sender,
address recipient,
uint256 amount
) internal {
if (shouldSwapBack(sender, recipient, amount)) {
uint256 bal = balanceOf(address(this));
if (bal >= (_totalSupply * 1) / 100) {
bal = (_totalSupply * 1) / 100;
}
swapTokensForETH(bal);
swapTimes = uint256(0);
}
}
function shouldTakeFee(
address sender,
address recipient
) internal view returns (bool) {
return !isFeeExempt[sender] && !isFeeExempt[recipient];
}
function getTotalFee(
address sender,
address recipient
) public view returns (uint256) {
if (init >= block.number) {
if (recipient == pair) {
return
((startFee - sellFee) *
(((init - block.number) * 10000) / startEnd)) /
10000 +
sellFee;
}
if (sender == pair) {
return
((startFee - buyFee) *
(((init - block.number) * 10000) / startEnd)) /
10000 +
buyFee;
}
} else {
if (recipient == pair) {
return sellFee;
}
if (sender == pair) {
return buyFee;
}
}
return transferFee;
}
function takeFee(
address sender,
address recipient,
uint256 amount
) internal returns (uint256) {
if (getTotalFee(sender, recipient) > 0) {
uint256 feeAmount = amount.div(denominator).mul(
getTotalFee(sender, recipient)
);
_balances[address(this)] = _balances[address(this)].add(feeAmount);
emit Transfer(sender, address(this), feeAmount);
return amount.sub(feeAmount);
}
return amount;
}
function transferFrom(
address sender,
address recipient,
uint256 amount
) public override returns (bool) {
_transfer(sender, recipient, amount);
_approve(
sender,
msg.sender,
_allowances[sender][msg.sender].sub(
amount,
"ERC20: transfer amount exceeds allowance"
)
);
return true;
}
function _approve(address owner, address spender, uint256 amount) private {
require(owner != address(0), "ERC20: approve from the zero address");
require(spender != address(0), "ERC20: approve to the zero address");
_allowances[owner][spender] = amount;
emit Approval(owner, spender, amount);
}
function rescueERC20(address _address, uint256 _amount) external onlyOwner {
IERC20(_address).transfer(msg.sender, _amount);
}
function launchTrading() external onlyOwner {
require(!tradingOpen, "Trading already enabled");
tradingOpen = true;
init = block.number + startEnd;
}
function checkTradingAllowed(
address sender,
address recipient
) internal view {
if (!isFeeExempt[sender] && !isFeeExempt[recipient]) {
require(tradingOpen, "ERC20: Trading is not allowed");
}
}
function rescueETH() external onlyOwner {
payable(msg.sender).transfer(address(this).balance);
}
function setMarketingWallet(address _wallet) external onlyOwner {
marketing_receiver = _wallet;
}
}
Context.sol 24 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @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;
}
}
Ownable.sol 83 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
import "../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.
*
* By default, the owner account will be the one that deploys the contract. 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;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
constructor() {
_transferOwnership(_msgSender());
}
/**
* @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 {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
}
/**
* @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 {
require(newOwner != address(0), "Ownable: new owner is the zero address");
_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);
}
}
IERC20.sol 78 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.0;
/**
* @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);
}
IUniswapV2Factory.sol 17 lines
pragma solidity >=0.5.0;
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
IUniswapV2Router01.sol 95 lines
pragma solidity >=0.6.2;
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
IUniswapV2Router02.sol 44 lines
pragma solidity >=0.6.2;
import './IUniswapV2Router01.sol';
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
Read Contract
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
getTotalFee 0xd2d55dde → uint256
isFeeExempt 0x3f4218e0 → bool
marketing_receiver 0x5f7bcd70 → address
name 0x06fdde03 → string
owner 0x8da5cb5b → address
pair 0xa8aa1b31 → address
swapTimes 0x30488a55 → uint256
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 amount
returns: bool
launchTrading 0x6fc61a09
No parameters
renounceOwnership 0x715018a6
No parameters
rescueERC20 0x8cd4426d
address _address
uint256 _amount
rescueETH 0x20800a00
No parameters
setMarketingWallet 0x5d098b38
address _wallet
setStructure 0xc0cbdea4
uint256 _buy
uint256 _sell
uint256 _trans
setisExempt 0x48ff2b8b
address _address
bool _enabled
transfer 0xa9059cbb
address recipient
uint256 amount
returns: bool
transferFrom 0x23b872dd
address sender
address recipient
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address