Address Contract Partially Verified
Address
0xDd929b38646Ca416D5bB1817F4d9106E0274b09d
Balance
0 ETH
Nonce
1
Code Size
10549 bytes
Creator
0x340D36ad...43C0 at tx 0xb8c146f4...4c8b83
Indexed Transactions
0
Contract Bytecode
10549 bytes
0x6080604052600436106102bf5760003560e01c80637f6bf20a1161016e578063c0246668116100cb578063e49988141161007f578063f2ecd8f611610064578063f2ecd8f6146107bf578063f2fde38b146107df578063fde83a34146107ff57600080fd5b8063e49988141461078a578063f0f442601461079f57600080fd5b8063d7c94efd116100b0578063d7c94efd14610719578063dd62ed3e1461072f578063e2f456051461077557600080fd5b8063c0246668146106c5578063c45a0155146106e557600080fd5b80639a7a23d611610122578063a9059cbb11610107578063a9059cbb14610655578063b62496f514610675578063ba22abc3146106a557600080fd5b80639a7a23d614610615578063a457c2d71461063557600080fd5b80638da5cb5b116101535780638da5cb5b146105cc57806395d89b41146105ea57806398118cb4146105ff57600080fd5b80637f6bf20a14610584578063860aefcf1461059a57600080fd5b80633ba246b61161021c57806361d027b3116101d057806370a08231116101b557806370a0823114610519578063715018a61461054f57806379cc67901461056457600080fd5b806361d027b3146104e45780636fe028551461050457600080fd5b806342966c681161020157806342966c681461043f57806349bd5a5e1461045f5780634fbee193146104ab57600080fd5b80633ba246b61461040957806340c10f191461041f57600080fd5b80631a8145bb1161027357806323b872dd1161025857806323b872dd146103ad578063313ce567146103cd57806339509351146103e957600080fd5b80631a8145bb14610375578063224290851461038b57600080fd5b80630c44a69e116102a45780630c44a69e1461032657806313114a9d1461034a57806318160ddd1461036057600080fd5b806306fdde03146102cb578063095ea7b3146102f657600080fd5b366102c657005b600080fd5b3480156102d757600080fd5b506102e0610815565b6040516102ed919061253d565b60405180910390f35b34801561030257600080fd5b506103166103113660046125a0565b6108a7565b60405190151581526020016102ed565b34801561033257600080fd5b5061033c60115481565b6040519081526020016102ed565b34801561035657600080fd5b5061033c60085481565b34801561036c57600080fd5b5060025461033c565b34801561038157600080fd5b5061033c600f5481565b34801561039757600080fd5b506103ab6103a63660046125cc565b6108c1565b005b3480156103b957600080fd5b506103166103c83660046125f8565b6109ad565b3480156103d957600080fd5b50604051600981526020016102ed565b3480156103f557600080fd5b506103166104043660046125a0565b6109d1565b34801561041557600080fd5b5061033c60095481565b34801561042b57600080fd5b506103ab61043a3660046125a0565b610a10565b34801561044b57600080fd5b506103ab61045a366004612639565b610a78565b34801561046b57600080fd5b506104937f000000000000000000000000d1a72dd4e13112ff4dde730075f87716a2b3729e81565b6040516001600160a01b0390911681526020016102ed565b3480156104b757600080fd5b506103166104c6366004612652565b6001600160a01b031660009081526013602052604090205460ff1690565b3480156104f057600080fd5b50600654610493906001600160a01b031681565b34801561051057600080fd5b506103ab610a85565b34801561052557600080fd5b5061033c610534366004612652565b6001600160a01b031660009081526020819052604090205490565b34801561055b57600080fd5b506103ab610ab4565b34801561057057600080fd5b506103ab61057f3660046125a0565b610ac6565b34801561059057600080fd5b5061033c600e5481565b3480156105a657600080fd5b506105af610ad0565b6040805193151584526020840192909252908201526060016102ed565b3480156105d857600080fd5b506005546001600160a01b0316610493565b3480156105f657600080fd5b506102e0610bb3565b34801561060b57600080fd5b5061033c600a5481565b34801561062157600080fd5b506103ab610630366004612684565b610bc2565b34801561064157600080fd5b506103166106503660046125a0565b610c12565b34801561066157600080fd5b506103166106703660046125a0565b610cbc565b34801561068157600080fd5b50610316610690366004612652565b60146020526000908152604090205460ff1681565b3480156106b157600080fd5b506103ab6106c0366004612639565b610cca565b3480156106d157600080fd5b506103ab6106e0366004612684565b610d7a565b3480156106f157600080fd5b506104937f000000000000000000000000340d36ad9daa21059d41d2c1259bce5862d043c081565b34801561072557600080fd5b5061033c600b5481565b34801561073b57600080fd5b5061033c61074a3660046126bd565b6001600160a01b03918216600090815260016020908152604080832093909416825291909152205490565b34801561078157600080fd5b5061033c610de1565b34801561079657600080fd5b5061033c606481565b3480156107ab57600080fd5b506103ab6107ba366004612652565b610e0c565b3480156107cb57600080fd5b506104936107da366004612639565b610e5d565b3480156107eb57600080fd5b506103ab6107fa366004612652565b610e87565b34801561080b57600080fd5b5061033c60105481565b606060038054610824906126eb565b80601f0160208091040260200160405190810160405280929190818152602001828054610850906126eb565b801561089d5780601f106108725761010080835404028352916020019161089d565b820191906000526020600020905b81548152906001019060200180831161088057829003601f168201915b5050505050905090565b6000336108b5818585610f14565b60019150505b92915050565b6108c961106c565b6009839055600a829055600b8190556064816108e5848661273b565b6108ef919061273b565b6108f9919061273b565b600855600b5460c810156109545760405162461bcd60e51b815260206004820152601860248201527f5465616d206665652063616e206e6f74206265203e203225000000000000000060448201526064015b60405180910390fd5b6101f460085411156109a85760405162461bcd60e51b815260206004820152601960248201527f546f74616c206665652063616e206e6f74206265203e20352500000000000000604482015260640161094b565b505050565b6000336109bb8582856110c6565b6109c6858585611158565b506001949350505050565b3360008181526001602090815260408083206001600160a01b03871684529091528120549091906108b59082908690610a0b90879061273b565b610f14565b6006546001600160a01b03163314610a6a5760405162461bcd60e51b815260206004820152600c60248201527f4e6f742074726561737572790000000000000000000000000000000000000000604482015260640161094b565b610a7482826115fd565b5050565b610a8233826116bc565b50565b610ab2307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d600019610f14565b565b610abc61106c565b610ab26000611825565b610a748282611884565b60008080610aff7f00000000000000000000000000000000000000000000000000000000671529a7605a61273b565b421115610b125750600092839250829150565b600192506103e8610b2260025490565b610b2d90600561274e565b610b379190612765565b9150610b647f00000000000000000000000000000000000000000000000000000000671529a7601e61273b565b4211610b7257506005909192565b610b9d7f00000000000000000000000000000000000000000000000000000000671529a7603c61273b565b4211610bab57506003909192565b506002909192565b606060048054610824906126eb565b610bca61106c565b7f000000000000000000000000d1a72dd4e13112ff4dde730075f87716a2b3729e6001600160a01b0316826001600160a01b031603610c0857600080fd5b610a7482826118ca565b3360008181526001602090815260408083206001600160a01b038716845290915281205490919083811015610caf5760405162461bcd60e51b815260206004820152602560248201527f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f7760448201527f207a65726f000000000000000000000000000000000000000000000000000000606482015260840161094b565b6109c68286868403610f14565b6000336108b5818585611158565b610cd261106c565b6001811015610d235760405162461bcd60e51b815260206004820152601360248201527f43616e206e6f74206265203c20302e3030312500000000000000000000000000604482015260640161094b565b6101f4811115610d755760405162461bcd60e51b815260206004820152601260248201527f43616e206e6f74206265203e20302e3530250000000000000000000000000000604482015260640161094b565b600755565b610d8261106c565b6001600160a01b038216600081815260136020908152604091829020805460ff191685151590811790915591519182527f9d8f7706ea1113d1a167b526eca956215946dd36cc7df39eb16180222d8b5df7910160405180910390a25050565b6000620186a0600754610df360025490565b610dfd919061274e565b610e079190612765565b905090565b610e1461106c565b6006546001600160a01b031615610e2a57600080fd5b6006805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b038316179055610a82816001610d7a565b600c8181548110610e6d57600080fd5b6000918252602090912001546001600160a01b0316905081565b610e8f61106c565b6001600160a01b038116610f0b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161094b565b610a8281611825565b6001600160a01b038316610f8f5760405162461bcd60e51b8152602060048201526024808201527f45524332303a20617070726f76652066726f6d20746865207a65726f2061646460448201527f7265737300000000000000000000000000000000000000000000000000000000606482015260840161094b565b6001600160a01b03821661100b5760405162461bcd60e51b815260206004820152602260248201527f45524332303a20617070726f766520746f20746865207a65726f20616464726560448201527f7373000000000000000000000000000000000000000000000000000000000000606482015260840161094b565b6001600160a01b0383811660008181526001602090815260408083209487168084529482529182902085905590518481527f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925910160405180910390a3505050565b6005546001600160a01b03163314610ab25760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161094b565b6001600160a01b03838116600090815260016020908152604080832093861683529290522054600019811461115257818110156111455760405162461bcd60e51b815260206004820152601d60248201527f45524332303a20696e73756666696369656e7420616c6c6f77616e6365000000604482015260640161094b565b6111528484848403610f14565b50505050565b6001600160a01b0383166111bc5760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161094b565b6001600160a01b03821661121e5760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161094b565b80600003611232576109a88383600061191e565b600080600061123f610ad0565b9250925092508215611356576005546001600160a01b0387811691161480159061127757506005546001600160a01b03868116911614155b801561128b57506001600160a01b03851615155b80156112a257506001600160a01b03851661dead14155b80156112b85750600654600160a01b900460ff16155b15611356576001600160a01b03861660009081526014602052604090205460ff161561135657816112fe866001600160a01b031660009081526020819052604090205490565b611308908661273b565b11156113565760405162461bcd60e51b815260206004820152601360248201527f4d61782077616c6c657420657863656564656400000000000000000000000000604482015260640161094b565b306000908152602081905260408120549061136f610de1565b821015905080801561138b5750600654600160a01b900460ff16155b80156113b057506001600160a01b03881660009081526014602052604090205460ff16155b80156113d557506001600160a01b03881660009081526013602052604090205460ff16155b80156113fa57506001600160a01b03871660009081526013602052604090205460ff16155b15611428576006805460ff60a01b1916600160a01b17905561141a611ad9565b6006805460ff60a01b191690555b6006546001600160a01b03891660009081526013602052604090205460ff600160a01b90920482161591168061147657506001600160a01b03881660009081526013602052604090205460ff165b1561147f575060005b600081156115e6576001600160a01b038a1660009081526014602052604090205460ff16806114c657506001600160a01b03891660009081526014602052604090205460ff165b80156114d457506000600854115b156115c857612710600854896114ea919061274e565b6114f49190612765565b9050861561150957611506858261274e565b90505b600854600a54611519908361274e565b6115239190612765565b600f6000828254611534919061273b565b9091555050600854600b54611549908361274e565b6115539190612765565b60106000828254611564919061273b565b9091555050600854600954611579908361274e565b6115839190612765565b600e6000828254611594919061273b565b90915550506008546115a760648361274e565b6115b19190612765565b601160008282546115c2919061273b565b90915550505b80156115d9576115d98a308361191e565b6115e38189612787565b97505b6115f18a8a8a61191e565b50505050505050505050565b6001600160a01b0382166116535760405162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015260640161094b565b8060026000828254611665919061273b565b90915550506001600160a01b038216600081815260208181526040808320805486019055518481527fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a35050565b6001600160a01b0382166117385760405162461bcd60e51b815260206004820152602160248201527f45524332303a206275726e2066726f6d20746865207a65726f2061646472657360448201527f7300000000000000000000000000000000000000000000000000000000000000606482015260840161094b565b6001600160a01b038216600090815260208190526040902054818110156117c75760405162461bcd60e51b815260206004820152602260248201527f45524332303a206275726e20616d6f756e7420657863656564732062616c616e60448201527f6365000000000000000000000000000000000000000000000000000000000000606482015260840161094b565b6001600160a01b0383166000818152602081815260408083208686039055600280548790039055518581529192917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3505050565b600580546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b03821660009081526001602090815260408083203384529091528120546118b3908390612787565b90506118c0833383610f14565b6109a883836116bc565b6001600160a01b038216600081815260146020526040808220805460ff191685151590811790915590519092917fffa9187bf1f18bf477bd0ea1bcbb64e93b6a98132473929edfce215cd9b16fab91a35050565b6001600160a01b0383166119825760405162461bcd60e51b815260206004820152602560248201527f45524332303a207472616e736665722066726f6d20746865207a65726f206164604482015264647265737360d81b606482015260840161094b565b6001600160a01b0382166119e45760405162461bcd60e51b815260206004820152602360248201527f45524332303a207472616e7366657220746f20746865207a65726f206164647260448201526265737360e81b606482015260840161094b565b6001600160a01b03831660009081526020819052604090205481811015611a735760405162461bcd60e51b815260206004820152602660248201527f45524332303a207472616e7366657220616d6f756e742065786365656473206260448201527f616c616e63650000000000000000000000000000000000000000000000000000606482015260840161094b565b6001600160a01b03848116600081815260208181526040808320878703905593871680835291849020805487019055925185815290927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef910160405180910390a3611152565b3060009081526020819052604081205490506000601154601054600e54600f54611b03919061273b565b611b0d919061273b565b611b17919061273b565b90506000821580611b26575081155b15611b3057505050565b611b38610de1565b611b4390601461274e565b831115611b6057611b52610de1565b611b5d90601461274e565b92505b6000600283600f5486611b73919061274e565b611b7d9190612765565b611b879190612765565b90506000611b958286612787565b9050600080611ba48387611e08565b9150915060006002600f54611bb99190612765565b611bc39088612787565b601054611bd0908561274e565b611bda9190612765565b905060006002600f54611bed9190612765565b611bf79089612787565b601154611c04908661274e565b611c0e9190612765565b905060008382611c1e8588612787565b611c289190612787565b611c329190612787565b6000600f819055600e81905560108190556011559050611c5a6005546001600160a01b031690565b6001600160a01b03168360405160006040518083038185875af1925050503d8060008114611ca4576040519150601f19603f3d011682016040523d82523d6000602084013e611ca9565b606091505b50909850508615801590611cbd5750600081115b15611ccc57611ccc8782612469565b60007f000000000000000000000000340d36ad9daa21059d41d2c1259bce5862d043c06001600160a01b031663fa8e39b26040518163ffffffff1660e01b8152600401602060405180830381865afa158015611d2c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d50919061279a565b9050806001600160a01b03164760405160006040518083038185875af1925050503d8060008114611d9d576040519150601f19603f3d011682016040523d82523d6000602084013e611da2565b606091505b505080995050806001600160a01b031663ba69ebed6040518163ffffffff1660e01b8152600401600060405180830381600087803b158015611de357600080fd5b505af1158015611df7573d6000803e3d6000fd5b505050505050505050505050505050565b6040805160028082526060820183526000928392839290916020830190803683370190505090503081600081518110611e4357611e436127b7565b60200260200101906001600160a01b031690816001600160a01b0316815250507f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc281600181518110611e9757611e976127b7565b6001600160a01b0392831660209182029290920101526040517f791ac9470000000000000000000000000000000000000000000000000000000081527f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d9091169063791ac94790611f15908890600090869030904290600401612811565b600060405180830381600087803b158015611f2f57600080fd5b505af1158015611f43573d6000803e3d6000fd5b505050504792506002600f54611f599190612765565b611f639085612787565b600e54611f70908561274e565b611f7a9190612765565b91506000600c60125481548110611f9357611f936127b7565b6000918252602090912001546001600160a01b03169050821561242b577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b0316816001600160a01b031603612115577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b031663d0e30db0846040518263ffffffff1660e01b81526004016000604051808303818588803b15801561204457600080fd5b505af1158015612058573d6000803e3d6000fd5b50506006546040517fa9059cbb0000000000000000000000000000000000000000000000000000000081526001600160a01b039182166004820152602481018890527f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2909116935063a9059cbb925060440190506020604051808303816000875af11580156120eb573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061210f919061284d565b5061242b565b600d6012548154811061212a5761212a6127b7565b90600052602060002090600a91828204019190066003029054906101000a900462ffffff1662ffffff1660000361227b577f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc28260008151811061218f5761218f6127b7565b60200260200101906001600160a01b031690816001600160a01b03168152505080826001815181106121c3576121c36127b7565b6001600160a01b0392831660209182029290920101526006546040517fb6f9de950000000000000000000000000000000000000000000000000000000081527f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d83169263b6f9de95928792612244926000928992911690429060040161286a565b6000604051808303818588803b15801561225d57600080fd5b505af1158015612271573d6000803e3d6000fd5b505050505061242b565b60006040518061010001604052807f000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc26001600160a01b03168152602001836001600160a01b03168152602001600d601254815481106122dc576122dc6127b7565b60009182526020808320600a8084049091015492066003026101000a90910462ffffff90811684526006546001600160a01b03908116858401524260408087019190915260608087018c9052608080880187905260a09788019690965281517f414bf389000000000000000000000000000000000000000000000000000000008152885184166004820152948801518316602486015290870151909216604484015290850151811660648301529184015160848201529183015160a483015260c083015160c483015260e0830151811660e48301529192507f000000000000000000000000e592427a0aece92de3edee1f18e0157c058615649091169063414bf3899086906101040160206040518083038185885af1158015612403573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612428919061289f565b50505b600c5461243a90600190612787565b6012540361244c576000601255612460565b60126000815461245b906128b8565b909155505b50509250929050565b6006546040517ff305d7190000000000000000000000000000000000000000000000000000000081523060048201526024810184905260006044820181905260648201526001600160a01b0391821660848201524260a48201527f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d9091169063f305d71990839060c40160606040518083038185885af1158015612511573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061253691906128d1565b5050505050565b600060208083528351808285015260005b8181101561256a5785810183015185820160400152820161254e565b506000604082860101526040601f19601f8301168501019250505092915050565b6001600160a01b0381168114610a8257600080fd5b600080604083850312156125b357600080fd5b82356125be8161258b565b946020939093013593505050565b6000806000606084860312156125e157600080fd5b505081359360208301359350604090920135919050565b60008060006060848603121561260d57600080fd5b83356126188161258b565b925060208401356126288161258b565b929592945050506040919091013590565b60006020828403121561264b57600080fd5b5035919050565b60006020828403121561266457600080fd5b813561266f8161258b565b9392505050565b8015158114610a8257600080fd5b6000806040838503121561269757600080fd5b82356126a28161258b565b915060208301356126b281612676565b809150509250929050565b600080604083850312156126d057600080fd5b82356126db8161258b565b915060208301356126b28161258b565b600181811c908216806126ff57607f821691505b60208210810361271f57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052601160045260246000fd5b808201808211156108bb576108bb612725565b80820281158282048414176108bb576108bb612725565b60008261278257634e487b7160e01b600052601260045260246000fd5b500490565b818103818111156108bb576108bb612725565b6000602082840312156127ac57600080fd5b815161266f8161258b565b634e487b7160e01b600052603260045260246000fd5b600081518084526020808501945080840160005b838110156128065781516001600160a01b0316875295820195908201906001016127e1565b509495945050505050565b85815284602082015260a06040820152600061283060a08301866127cd565b6001600160a01b0394909416606083015250608001529392505050565b60006020828403121561285f57600080fd5b815161266f81612676565b84815260806020820152600061288360808301866127cd565b6001600160a01b03949094166040830152506060015292915050565b6000602082840312156128b157600080fd5b5051919050565b6000600182016128ca576128ca612725565b5060010190565b6000806000606084860312156128e657600080fd5b835192506020840151915060408401519050925092509256fea2646970667358221220b3deb39784300eb4c2985473759732d17e01243b2f560a6c9a53e764f9d48d7264736f6c63430008130033
Verified Source Code Partial Match
Compiler: v0.8.19+commit.7dd6d404
EVM: paris
Optimization: Yes (1000 runs)
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);
}
}
ERC20.sol 365 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.0;
import "./IERC20.sol";
import "./extensions/IERC20Metadata.sol";
import "../../utils/Context.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}.
* For a generic mechanism see {ERC20PresetMinterPauser}.
*
* 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.
*
* Finally, the non-standard {decreaseAllowance} and {increaseAllowance}
* functions have been added to mitigate the well-known issues around setting
* allowances. See {IERC20-approve}.
*/
contract ERC20 is Context, IERC20, IERC20Metadata {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => 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 override returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual override 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 override returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual override returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual override 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 `amount`.
*/
function transfer(address to, uint256 amount) public virtual override returns (bool) {
address owner = _msgSender();
_transfer(owner, to, amount);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender) public view virtual override returns (uint256) {
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `amount` 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 amount) public virtual override returns (bool) {
address owner = _msgSender();
_approve(owner, spender, amount);
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 `amount`.
* - the caller must have allowance for ``from``'s tokens of at least
* `amount`.
*/
function transferFrom(address from, address to, uint256 amount) public virtual override returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, amount);
_transfer(from, to, amount);
return true;
}
/**
* @dev Atomically increases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {
address owner = _msgSender();
_approve(owner, spender, allowance(owner, spender) + addedValue);
return true;
}
/**
* @dev Atomically decreases the allowance granted to `spender` by the caller.
*
* This is an alternative to {approve} that can be used as a mitigation for
* problems described in {IERC20-approve}.
*
* Emits an {Approval} event indicating the updated allowance.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `spender` must have allowance for the caller of at least
* `subtractedValue`.
*/
function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {
address owner = _msgSender();
uint256 currentAllowance = allowance(owner, spender);
require(currentAllowance >= subtractedValue, "ERC20: decreased allowance below zero");
unchecked {
_approve(owner, spender, currentAllowance - subtractedValue);
}
return true;
}
/**
* @dev Moves `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.
*
* Requirements:
*
* - `from` cannot be the zero address.
* - `to` cannot be the zero address.
* - `from` must have a balance of at least `amount`.
*/
function _transfer(address from, address to, uint256 amount) internal virtual {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
_beforeTokenTransfer(from, to, amount);
uint256 fromBalance = _balances[from];
require(fromBalance >= amount, "ERC20: transfer amount exceeds balance");
unchecked {
_balances[from] = fromBalance - amount;
// Overflow not possible: the sum of all balances is capped by totalSupply, and the sum is preserved by
// decrementing then incrementing.
_balances[to] += amount;
}
emit Transfer(from, to, amount);
_afterTokenTransfer(from, to, amount);
}
/** @dev Creates `amount` tokens and assigns them to `account`, increasing
* the total supply.
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
*/
function _mint(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: mint to the zero address");
_beforeTokenTransfer(address(0), account, amount);
_totalSupply += amount;
unchecked {
// Overflow not possible: balance + amount is at most totalSupply + amount, which is checked above.
_balances[account] += amount;
}
emit Transfer(address(0), account, amount);
_afterTokenTransfer(address(0), account, amount);
}
/**
* @dev Destroys `amount` tokens from `account`, reducing the
* total supply.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* Requirements:
*
* - `account` cannot be the zero address.
* - `account` must have at least `amount` tokens.
*/
function _burn(address account, uint256 amount) internal virtual {
require(account != address(0), "ERC20: burn from the zero address");
_beforeTokenTransfer(account, address(0), amount);
uint256 accountBalance = _balances[account];
require(accountBalance >= amount, "ERC20: burn amount exceeds balance");
unchecked {
_balances[account] = accountBalance - amount;
// Overflow not possible: amount <= accountBalance <= totalSupply.
_totalSupply -= amount;
}
emit Transfer(account, address(0), amount);
_afterTokenTransfer(account, address(0), amount);
}
/**
* @dev Sets `amount` 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.
*/
function _approve(address owner, address spender, uint256 amount) internal virtual {
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);
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `amount`.
*
* Does not update the allowance amount in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Might emit an {Approval} event.
*/
function _spendAllowance(address owner, address spender, uint256 amount) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
require(currentAllowance >= amount, "ERC20: insufficient allowance");
unchecked {
_approve(owner, spender, currentAllowance - amount);
}
}
}
/**
* @dev Hook that is called before any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* will be transferred to `to`.
* - when `from` is zero, `amount` tokens will be minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens will be burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual {}
/**
* @dev Hook that is called after any transfer of tokens. This includes
* minting and burning.
*
* Calling conditions:
*
* - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens
* has been transferred to `to`.
* - when `from` is zero, `amount` tokens have been minted for `to`.
* - when `to` is zero, `amount` of ``from``'s tokens have been burned.
* - `from` and `to` are never both zero.
*
* To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].
*/
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual {}
}
IERC20Metadata.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.0;
import "../IERC20.sol";
/**
* @dev Interface for the optional metadata functions from the ERC20 standard.
*
* _Available since v4.1._
*/
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);
}
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);
}
Context.sol 28 lines
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.4) (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;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}
PonzieExpressRebasingToken.sol 473 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.19;
pragma experimental ABIEncoderV2;
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint256);
function createPair(address tokenA, address tokenB) external returns (address pair);
}
interface IPonziEpxressFactory {
function feesTo() external view returns (address);
}
interface IFeesTo {
function processFees() external;
}
interface IUniswapV2Router02 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidityETH(
address token,
uint256 amountTokenDesired,
uint256 amountTokenMin,
uint256 amountETHMin,
address to,
uint256 deadline
) external payable returns (uint256 amountToken, uint256 amountETH, uint256 liquidity);
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint256 amountIn,
uint256 amountOutMin,
address[] calldata path,
address to,
uint256 deadline
) external;
}
interface IUniswapV3Router {
struct ExactInputSingleParams {
address tokenIn;
address tokenOut;
uint24 fee;
address recipient;
uint256 deadline;
uint256 amountIn;
uint256 amountOutMinimum;
uint160 sqrtPriceLimitX96;
}
function exactInputSingle(ExactInputSingleParams calldata params) external payable returns (uint256 amountOut);
}
interface IWETH {
function deposit() external payable;
function withdraw(uint256) external;
}
/// @title PonzieExpressRebasingToken
/// @notice Ponzi Express Rebasing
contract PonzieExpressRebasingToken is ERC20, Ownable {
/// STATE VARIABLES ///
/// @notice Address of UniswapV2Router
IUniswapV2Router02 private immutable uniswapV2Router;
/// @notice Address of LP
address public immutable uniswapV2Pair;
/// @notice Address of UniswapV3Router
address private immutable uniswapV3Router;
/// @notice WETH address
address private immutable WETH = 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
/// @notice Address of factory
address public immutable factory;
/// @notice Address of Treasury
address public treasury;
bool private swapping;
/// @notice Current percent of supply to swap tokens at (i.e. 50 = 0.05%)
uint256 private swapPercent;
/// @notice Current total fees
uint256 public totalFees;
/// @notice Current backing fee
uint256 public backingFee;
/// @notice Current liquidity fee
uint256 public liquidityFee;
/// @notice 1% Ponzi Epxress fee
uint256 public constant POZNI_EXPRESS_FEE = 100;
/// @notice Current team fee
uint256 public teamFee;
/// @notice Backing token addresses
address[] public backingTokens;
/// @notice Backing token V3 pool fee to swap (if 0 - v2)
uint24[] private backingTokensV3Fee;
/// @notice Current tokens going for backing
uint256 public tokensForBacking;
/// @notice Current tokens going for liquidity
uint256 public tokensForLiquidity;
/// @notice Current tokens going for team
uint256 public tokensForTeam;
/// @notice Current tokens going towards fee
uint256 public tokensForFee;
/// @notice Timestamp deployed
uint256 private immutable timeStampDeployed;
/// @notice Index backing swapping
uint256 private backingSwapping;
/// MAPPINGS ///
/// @dev Bool if address is excluded from fees
mapping(address => bool) private _isExcludedFromFees;
/// @notice Bool if address is AMM pair
mapping(address => bool) public automatedMarketMakerPairs;
/// EVENTS ///
event ExcludeFromFees(address indexed account, bool isExcluded);
event SetAutomatedMarketMakerPair(address indexed pair, bool indexed value);
/// CONSTRUCTOR ///
constructor(
address[] memory _backingTokens,
uint24[] memory _backingTokensV3Fee,
string memory _name,
string memory _symbol
) ERC20(_name, _symbol) {
timeStampDeployed = block.timestamp;
factory = msg.sender;
backingTokens = _backingTokens;
backingTokensV3Fee = _backingTokensV3Fee;
IUniswapV2Router02 _uniswapV2Router = IUniswapV2Router02(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
_approve(address(this), address(_uniswapV2Router), type(uint256).max);
uniswapV2Router = _uniswapV2Router;
uniswapV2Pair = IUniswapV2Factory(_uniswapV2Router.factory()).createPair(address(this), WETH);
_setAutomatedMarketMakerPair(address(uniswapV2Pair), true);
uniswapV3Router = 0xE592427A0AEce92De3Edee1F18E0157C05861564;
swapPercent = 100; // 0.1%
liquidityFee = 150;
backingFee = 150;
teamFee = 100;
totalFees = 500;
// exclude from paying fees
_isExcludedFromFees[msg.sender] = true;
_isExcludedFromFees[address(this)] = true;
_mint(msg.sender, 100_000_000 * 10 ** 9);
}
/// RECEIVE ///
receive() external payable {}
/// AMM PAIR ///
/// @notice Sets if address is AMM pair
/// @param pair Address of pair
/// @param value Bool if AMM pair
function setAutomatedMarketMakerPair(address pair, bool value) public onlyOwner {
require(pair != uniswapV2Pair);
_setAutomatedMarketMakerPair(pair, value);
}
/// @dev Internal function to set `vlaue` of `pair`
function _setAutomatedMarketMakerPair(address pair, bool value) private {
automatedMarketMakerPairs[pair] = value;
emit SetAutomatedMarketMakerPair(pair, value);
}
/// TREASURY FUNCTION ///
/// @notice Mint Token
/// @param account Address being minted to
/// @param amount Amount to mint
function mint(address account, uint256 amount) external {
require(msg.sender == treasury, "Not treasury");
_mint(account, amount);
}
/// INTERNAL TRANSFER ///
/// @dev Internal function to burn `amount` from `account`
function _burnFrom(address account, uint256 amount) internal {
uint256 decreasedAllowance_ = allowance(account, msg.sender) - amount;
_approve(account, msg.sender, decreasedAllowance_);
_burn(account, amount);
}
/// @dev Internal function to transfer - handles fee logic
function _transfer(address from, address to, uint256 amount) internal override {
require(from != address(0), "ERC20: transfer from the zero address");
require(to != address(0), "ERC20: transfer to the zero address");
if (amount == 0) {
super._transfer(from, to, 0);
return;
}
(bool _limits, uint256 _maxWallet, uint256 _taxMultiplier) = limits();
if (_limits) {
if (from != owner() && to != owner() && to != address(0) && to != address(0xdead) && !swapping) {
//when buy
if (automatedMarketMakerPairs[from]) {
require(amount + balanceOf(to) <= _maxWallet, "Max wallet exceeded");
}
}
}
uint256 contractTokenBalance = balanceOf(address(this));
bool canSwap = contractTokenBalance >= swapTokensAtAmount();
if (
canSwap && !swapping && !automatedMarketMakerPairs[from] && !_isExcludedFromFees[from]
&& !_isExcludedFromFees[to]
) {
swapping = true;
swapBack();
swapping = false;
}
bool takeFee = !swapping;
// if any account belongs to _isExcludedFromFee account then remove the fee
if (_isExcludedFromFees[from] || _isExcludedFromFees[to]) {
takeFee = false;
}
uint256 fees;
// only take fees on buys/sells, do not take on wallet transfers
if (takeFee) {
// on buy or sell
if ((automatedMarketMakerPairs[from] || automatedMarketMakerPairs[to]) && totalFees > 0) {
fees = (amount * totalFees) / 10000;
if (_limits) fees = fees * _taxMultiplier;
tokensForLiquidity += (fees * liquidityFee) / totalFees;
tokensForTeam += (fees * teamFee) / totalFees;
tokensForBacking += (fees * backingFee) / totalFees;
tokensForFee += (fees * POZNI_EXPRESS_FEE) / totalFees;
}
if (fees > 0) {
super._transfer(from, address(this), fees);
}
amount -= fees;
}
super._transfer(from, to, amount);
}
/// VIEW FUNCTION ///
/// @notice Returns decimals for Ponzi Express Rebasing Token
function decimals() public view virtual override returns (uint8) {
return 9;
}
/// @notice Returns if address is excluded from fees
function isExcludedFromFees(address account) external view returns (bool) {
return _isExcludedFromFees[account];
}
/// @notice Returns at what percent of supply to swap tokens at
function swapTokensAtAmount() public view returns (uint256 amount_) {
amount_ = (totalSupply() * swapPercent) / 100000;
}
/// @dev Returns limits if limit in effect
function limits() public view returns (bool limits_, uint256 maxAmount_, uint256 taxMultiplier_) {
if (block.timestamp > timeStampDeployed + 90) return (false, 0, 0);
limits_ = true;
maxAmount_ = (totalSupply() * 5) / 1000; // 0.5% max during for first 90 seconds
if (block.timestamp <= timeStampDeployed + 30) {
taxMultiplier_ = 5;
} // 25% tax 1st 30 seconds
else if (block.timestamp <= timeStampDeployed + 60) {
taxMultiplier_ = 3;
} // 15% tax 2nd 30 seconds
else {
taxMultiplier_ = 2;
} // 10% tax 3rd 30 seconds
}
/// USER FUNCTIONS ///
/// @notice Function for mass approval
function massApproval() external {
_approve(address(this), address(uniswapV2Router), type(uint256).max);
}
/// @notice Burn token
/// @param account Address to burn token from
/// @param amount Amount to token to burn
function burnFrom(address account, uint256 amount) external {
_burnFrom(account, amount);
}
/// @notice Burn token
/// @param amount Amount to token to burn
function burn(uint256 amount) external {
_burn(msg.sender, amount);
}
/// PRIVATE FUNCTIONS ///
/// @dev PRIVATE function to swap `ethTokenAmount` for ETH
/// @dev Invoked in `swapBack()`
function swapTokens(uint256 ethTokenAmount, uint256 totalTokensToSwap)
private
returns (uint256 ethBalance_, uint256 ethForBacking_)
{
address[] memory path = new address[](2);
path[0] = address(this);
path[1] = WETH;
uniswapV2Router.swapExactTokensForETHSupportingFeeOnTransferTokens(
ethTokenAmount, 0, path, address(this), block.timestamp
);
ethBalance_ = address(this).balance;
ethForBacking_ = (ethBalance_ * tokensForBacking) / (totalTokensToSwap - tokensForLiquidity / 2);
address backingToken = backingTokens[backingSwapping];
if (ethForBacking_ > 0) {
if (backingToken == WETH) {
IWETH(WETH).deposit{value: ethForBacking_}();
IERC20(WETH).transfer(treasury, ethForBacking_);
} else {
if (backingTokensV3Fee[backingSwapping] == 0) {
path[0] = WETH;
path[1] = backingToken;
uniswapV2Router.swapExactETHForTokensSupportingFeeOnTransferTokens{value: ethForBacking_}(
0, path, treasury, block.timestamp
);
} else {
IUniswapV3Router.ExactInputSingleParams memory params = IUniswapV3Router.ExactInputSingleParams({
tokenIn: WETH,
tokenOut: backingToken,
fee: backingTokensV3Fee[backingSwapping],
recipient: treasury,
deadline: block.timestamp,
amountIn: ethForBacking_,
amountOutMinimum: 0,
sqrtPriceLimitX96: 0
});
IUniswapV3Router(uniswapV3Router).exactInputSingle{value: ethForBacking_}(params);
}
}
}
if (backingSwapping == backingTokens.length - 1) backingSwapping = 0;
else ++backingSwapping;
}
/// @dev PRIVATE function to add `tokenAmount` and `ethAmount` to LP
/// @dev Invoked in `swapBack()`
function addLiquidity(uint256 tokenAmount, uint256 ethAmount) private {
uniswapV2Router.addLiquidityETH{value: ethAmount}(address(this), tokenAmount, 0, 0, treasury, block.timestamp);
}
/// SWAP ///
/// @dev Function to transfer fees properly
/// @dev Invoked in `_transfer()`
function swapBack() private {
uint256 contractBalance = balanceOf(address(this));
uint256 totalTokensToSwap = tokensForLiquidity + tokensForBacking + tokensForTeam + tokensForFee;
bool success;
if (contractBalance == 0 || totalTokensToSwap == 0) {
return;
}
if (contractBalance > swapTokensAtAmount() * 20) {
contractBalance = swapTokensAtAmount() * 20;
}
uint256 liquidityTokens = (contractBalance * tokensForLiquidity) / totalTokensToSwap / 2;
uint256 amountToSwapForETH = contractBalance - liquidityTokens;
(uint256 ethBalance, uint256 ethForBacking) = swapTokens(amountToSwapForETH, totalTokensToSwap);
uint256 ethForTeam = (ethBalance * tokensForTeam) / (totalTokensToSwap - tokensForLiquidity / 2);
uint256 ethForFee = (ethBalance * tokensForFee) / (totalTokensToSwap - tokensForLiquidity / 2);
uint256 ethForLiquidity = ethBalance - ethForTeam - ethForFee - ethForBacking;
tokensForLiquidity = 0;
tokensForBacking = 0;
tokensForTeam = 0;
tokensForFee = 0;
(success,) = address(owner()).call{value: ethForTeam}("");
if (liquidityTokens > 0 && ethForLiquidity > 0) {
addLiquidity(liquidityTokens, ethForLiquidity);
}
address _feesTo = IPonziEpxressFactory(factory).feesTo();
(success,) = address(_feesTo).call{value: address(this).balance}("");
IFeesTo(_feesTo).processFees();
}
/// OWNER FUNCTIONS ///
/// @notice Set address of treasury
function setTreasury(address _treasury) external onlyOwner {
require(treasury == address(0));
treasury = _treasury;
excludeFromFees(_treasury, true);
}
/// @notice Update percent of supply to swap tokens at
function updateSwapTokensAtPercent(uint256 newPercent) external onlyOwner {
require(newPercent >= 1, "Can not be < 0.001%");
require(newPercent <= 500, "Can not be > 0.50%");
swapPercent = newPercent;
}
/// @notice Update fees
function updateFees(uint256 _backingFee, uint256 _liquidityFee, uint256 _teamFee) external onlyOwner {
backingFee = _backingFee;
liquidityFee = _liquidityFee;
teamFee = _teamFee;
totalFees = backingFee + liquidityFee + teamFee + POZNI_EXPRESS_FEE;
require(teamFee <= 200, "Team fee can not be > 2%");
require(totalFees <= 500, "Total fee can not be > 5%");
}
/// @notice Set if an address is excluded from fees
function excludeFromFees(address account, bool excluded) public onlyOwner {
_isExcludedFromFees[account] = excluded;
emit ExcludeFromFees(account, excluded);
}
}
Read Contract
POZNI_EXPRESS_FEE 0xe4998814 → uint256
allowance 0xdd62ed3e → uint256
automatedMarketMakerPairs 0xb62496f5 → bool
backingFee 0x3ba246b6 → uint256
backingTokens 0xf2ecd8f6 → address
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
factory 0xc45a0155 → address
isExcludedFromFees 0x4fbee193 → bool
limits 0x860aefcf → bool, uint256, uint256
liquidityFee 0x98118cb4 → uint256
name 0x06fdde03 → string
owner 0x8da5cb5b → address
swapTokensAtAmount 0xe2f45605 → uint256
symbol 0x95d89b41 → string
teamFee 0xd7c94efd → uint256
tokensForBacking 0x7f6bf20a → uint256
tokensForFee 0x0c44a69e → uint256
tokensForLiquidity 0x1a8145bb → uint256
tokensForTeam 0xfde83a34 → uint256
totalFees 0x13114a9d → uint256
totalSupply 0x18160ddd → uint256
treasury 0x61d027b3 → address
uniswapV2Pair 0x49bd5a5e → address
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 amount
returns: bool
burn 0x42966c68
uint256 amount
burnFrom 0x79cc6790
address account
uint256 amount
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
excludeFromFees 0xc0246668
address account
bool excluded
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
massApproval 0x6fe02855
No parameters
mint 0x40c10f19
address account
uint256 amount
renounceOwnership 0x715018a6
No parameters
setAutomatedMarketMakerPair 0x9a7a23d6
address pair
bool value
setTreasury 0xf0f44260
address _treasury
transfer 0xa9059cbb
address to
uint256 amount
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 amount
returns: bool
transferOwnership 0xf2fde38b
address newOwner
updateFees 0x22429085
uint256 _backingFee
uint256 _liquidityFee
uint256 _teamFee
updateSwapTokensAtPercent 0xba22abc3
uint256 newPercent
Recent Transactions
No transactions found for this address