Cryo Explorer Ethereum Mainnet

Address Contract Partially Verified

Address 0x7965e7622a38407c118cCb400de9EaF5DbF04415
Balance 0 ETH
Nonce 1
Code Size 9209 bytes
Indexed Transactions 0
External Etherscan · Sourcify

Contract Bytecode

9209 bytes
0x60806040526004361061024a5760003560e01c806370a0823111610139578063a457c2d7116100b6578063dd62ed3e1161007a578063dd62ed3e14610692578063ddf731f3146106d8578063e0956e0f146106f8578063e399ab911461071a578063e47a966a14610730578063e5e31b131461075057600080fd5b8063a457c2d7146105c6578063a9059cbb146105e6578063b91ac78814610606578063d547741f1461063e578063d7091b711461065e57600080fd5b80638cb6768d116100fd5780638cb6768d146105425780639079f9321461056257806391d148541461057c57806395d89b411461059c578063a217fddf146105b157600080fd5b806370a08231146104b9578063733948c1146104d957806378f353a1146104ec5780637b8e378a1461050257806384a41ba71461052257600080fd5b80632ac3495a116101c757806336568abe1161018b57806336568abe1461042d578063395093511461044d57806353eb3bcf1461046d578063616eb638146104825780637015f2271461049757600080fd5b80632ac3495a146103a15780632b112e49146103c15780632bb35ec0146103d65780632f2ff15d146103eb578063313ce5671461040b57600080fd5b806318160ddd1161020e57806318160ddd146103045780631872d96d146103275780631ff8d5071461033c57806323b872dd14610351578063248a9ca31461037157600080fd5b806301ffc9a71461025657806303b1e00a1461028b57806304b638af146102ad57806306fdde03146102c2578063095ea7b3146102e457600080fd5b3661025157005b600080fd5b34801561026257600080fd5b50610276610271366004611e18565b610780565b60405190151581526020015b60405180910390f35b34801561029757600080fd5b506102ab6102a6366004611e5e565b6107b7565b005b3480156102b957600080fd5b506102ab6108e1565b3480156102ce57600080fd5b506102d7610979565b6040516102829190611e8a565b3480156102f057600080fd5b506102766102ff366004611e5e565b610a0b565b34801561031057600080fd5b50610319610a77565b604051908152602001610282565b34801561033357600080fd5b506102ab610a9b565b34801561034857600080fd5b506102ab610ad2565b34801561035d57600080fd5b5061027661036c366004611ed8565b610afb565b34801561037d57600080fd5b5061031961038c366004611f19565b60009081526003602052604090206001015490565b3480156103ad57600080fd5b506102ab6103bc366004611f47565b610b8f565b3480156103cd57600080fd5b50610319610bd3565b3480156103e257600080fd5b506102ab610c60565b3480156103f757600080fd5b506102ab610406366004611f7a565b610c93565b34801561041757600080fd5b5060025460405160ff9091168152602001610282565b34801561043957600080fd5b506102ab610448366004611f7a565b610cbe565b34801561045957600080fd5b50610276610468366004611e5e565b610cf6565b34801561047957600080fd5b506102ab610d87565b34801561048e57600080fd5b506102ab610daa565b3480156104a357600080fd5b5061031960008051602061238483398151915281565b3480156104c557600080fd5b506103196104d4366004611faa565b610e2a565b6102ab6104e7366004611faa565b610e51565b3480156104f857600080fd5b5061031960115481565b34801561050e57600080fd5b5061031961051d366004611fc7565b6110cc565b34801561052e57600080fd5b506102ab61053d366004611f19565b61113c565b34801561054e57600080fd5b506102ab61055d366004612003565b61115c565b34801561056e57600080fd5b50600e546102769060ff1681565b34801561058857600080fd5b50610276610597366004611f7a565b6111eb565b3480156105a857600080fd5b506102d7611216565b3480156105bd57600080fd5b50610319600081565b3480156105d257600080fd5b506102766105e1366004611e5e565b611225565b3480156105f257600080fd5b50610276610601366004611e5e565b611302565b34801561061257600080fd5b50610626610621366004611f19565b61132e565b6040516001600160a01b039091168152602001610282565b34801561064a57600080fd5b506102ab610659366004611f7a565b611358565b34801561066a57600080fd5b506103197f00000000000000000000000000000000000000000000000000097951b73dfa0081565b34801561069e57600080fd5b506103196106ad366004612093565b6001600160a01b039182166000908152600d6020908152604080832093909416825291909152205490565b3480156106e457600080fd5b506102ab6106f3366004611faa565b61137d565b34801561070457600080fd5b506103196000805160206123a483398151915281565b34801561072657600080fd5b50610319600f5481565b34801561073c57600080fd5b506102ab61074b366004611e5e565b611438565b34801561075c57600080fd5b5061027661076b366004611faa565b60076020526000908152604090205460ff1681565b60006001600160e01b03198216637965db0b60e01b14806107b157506301ffc9a760e01b6001600160e01b03198316145b92915050565b6000805160206123a48339815191526107cf816114e8565b6000600b54836107df91906120d7565b6001600160a01b0385166000908152600d6020908152604080832033845290915290205490915060001914610847576001600160a01b0384166000908152600d60209081526040808320338452909152812080548592906108419084906120ee565b90915550505b6001600160a01b0384166000908152600c60205260408120805483929061086f9084906120ee565b9250508190555080600a60008282546108889190612101565b9091555050600b546000906001600160a01b038616907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906108ca908561212a565b60405190815260200160405180910390a350505050565b6000601154426108f191906120ee565b9050600060105482610903919061212a565b600e5490915060ff1680156109185750600081115b1561097557610959620186a082600f5460095461093591906120d7565b61093f91906120d7565b610949919061212a565b6109529061213e565b60006114f2565b50601054610967908361215a565b61097190426120ee565b6011555b5050565b6060600080546109889061216e565b80601f01602080910402602001604051908101604052809291908181526020018280546109b49061216e565b8015610a015780601f106109d657610100808354040283529160200191610a01565b820191906000526020600020905b8154815290600101906020018083116109e457829003601f168201915b5050505050905090565b336000818152600d602090815260408083206001600160a01b038716808552925280832085905551919290917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b92590610a669086815260200190565b60405180910390a350600192915050565b6000600b54600a54610a89919061212a565b600954610a9691906120ee565b905090565b6000610aa6816114e8565b610acf7f00000000000000000000000000000000000000000000000000097951b73dfa006117c4565b50565b6000610add816114e8565b506012805461ff001981166101009182900460ff1615909102179055565b6000826001600160a01b038116610b1157600080fd5b6001600160a01b0385166000908152600d6020908152604080832033845290915290205460001914610b76576001600160a01b0385166000908152600d6020908152604080832033845290915281208054859290610b709084906120ee565b90915550505b610b818585856119e2565b50600191505b509392505050565b6000610b9a816114e8565b611388831115610ba957600080fd5b610e10821015610bb857600080fd5b50600e805460ff191693151593909317909255600f55601055565b600b54600a546005546001600160a01b039081166000908152600c602052604080822054600454909316825281205490939291610c0f91612101565b610c199190612101565b610c256009600a61228c565b610c349064cef5e80ac06120d7565b610c409060001961215a565b610c4c906000196120ee565b610c5691906120ee565b610a96919061212a565b6000610c6b816114e8565b60145460ff1615610c7b57600080fd5b50436013556014805460ff1916600117905542601155565b600082815260036020526040902060010154610cae816114e8565b610cb88383611c9e565b50505050565b6001600160a01b0381163314610ce75760405163334bd91960e11b815260040160405180910390fd5b610cf18282611d32565b505050565b336000908152600d602090815260408083206001600160a01b0386168452909152812080548391908390610d2b908490612101565b9091555050336000818152600d602090815260408083206001600160a01b038816808552908352928190205490519081529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259101610a66565b6000610d92816114e8565b60135415610d9f57600080fd5b504360135542601155565b478015610acf5760007f000000000000000000000000192a4f559ff5b8ae8d78914078f6f592055ab8136001600160a01b03168260405160006040518083038185875af1925050503d8060008114610e1e576040519150601f19603f3d011682016040523d82523d6000602084013e610e23565b606091505b5050505050565b600b546001600160a01b0382166000908152600c602052604081205490916107b19161212a565b6000610e5c816114e8565b60007f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015610ebc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ee09190612298565b6001600160a01b031663c9c65396307f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa158015610f4d573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f719190612298565b6040516001600160e01b031960e085901b1681526001600160a01b039283166004820152911660248201526044016020604051808303816000875af1158015610fbe573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610fe29190612298565b9050610fed8161137d565b7f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663f305d719473061102730610e2a565b6040516001600160e01b031960e086901b1681526001600160a01b0392831660048201526024810191909152600060448201819052606482015290871660848201524260a482015260c40160606040518083038185885af1158015611090573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906110b591906122b5565b50506012805461ff00191661010017905550505050565b60006000805160206123a48339815191526110e6816114e8565b83156111165761110f6064866009546110ff91906120d7565b611109919061212a565b846114f2565b9150610b87565b61110f60648660095461112991906120d7565b611133919061212a565b6111099061213e565b6000611147816114e8565b610e1082101561115657600080fd5b50601055565b6000611167816114e8565b60005b838110156111e35760008681526003602052604081208491878785818110611194576111946122e3565b90506020020160208101906111a99190611faa565b6001600160a01b031681526020810191909152604001600020805460ff1916911515919091179055806111db816122f9565b91505061116a565b505050505050565b60009182526003602090815260408084206001600160a01b0393909316845291905290205460ff1690565b6060600180546109889061216e565b336000908152600d602090815260408083206001600160a01b0386168452909152812054821061127857336000908152600d602090815260408083206001600160a01b03871684529091528120556112ab565b336000908152600d602090815260408083206001600160a01b038716845290915281208054849290610d2b9084906120ee565b336000818152600d602090815260408083206001600160a01b038816808552908352928190205490519081529192917f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259101610a66565b6000826001600160a01b03811661131857600080fd5b6113233385856119e2565b506001949350505050565b6006818154811061133e57600080fd5b6000918252602090912001546001600160a01b0316905081565b600082815260036020526040902060010154611373816114e8565b610cb88383611d32565b6000611388816114e8565b600654600a116113d05760405162461bcd60e51b815260206004820152600e60248201526d546f6f206d616e7920706169727360901b60448201526064015b60405180910390fd5b506006805460018181019092557ff652222313e28459528d920b65115c16c04f3efc82aaedc97be59f3f377c0d3f0180546001600160a01b039093166001600160a01b031990931683179055600091825260076020526040909120805460ff19169091179055565b6000805160206123a4833981519152611450816114e8565b6000600b548361146091906120d7565b6001600160a01b0385166000908152600c602052604081208054929350839290919061148d908490612101565b9250508190555080600a60008282546114a691906120ee565b9091555050600b546001600160a01b038516906000907fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef906108ca908561212a565b610acf8133611d9f565b600082600003611540577f60633057fb2c2558942a126acc1dc7c639b6fdee660a0171f7500e2ac5918b2e60095460405161152f91815260200190565b60405180910390a1506009546107b1565b600083121561156e576115528361213e565b6009600082825461156391906120ee565b909155506115869050565b82600960008282546115809190612101565b90915550505b6009546001600160801b0310156115a3576001600160801b036009555b600b5460098054906115b690600a61228c565b6115c59064cef5e80ac06120d7565b6115d19060001961215a565b6115dd906000196120ee565b6115e7919061212a565b600b556000805b60065481101561177c5760006006828154811061160d5761160d6122e3565b6000918252602090912001546001600160a01b031690508561171b5760008712156116ac5761163b81610e2a565b6001600160a01b0382166000908152600c602052604090205461165f90869061212a565b61166991906120ee565b9250600b548361167991906120d7565b6001600160a01b0382166000908152600c6020526040812080549091906116a1908490612101565b909155506117699050565b6001600160a01b0381166000908152600c60205260409020546116d090859061212a565b6116d982610e2a565b6116e391906120ee565b9250600b54836116f391906120d7565b6001600160a01b0382166000908152600c6020526040812080549091906116a19084906120ee565b806001600160a01b031663fff6cae96040518163ffffffff1660e01b8152600401600060405180830381600087803b15801561175657600080fd5b505af1925050508015611767575060015b505b5080611774816122f9565b9150506115ee565b507f60633057fb2c2558942a126acc1dc7c639b6fdee660a0171f7500e2ac5918b2e6009546040516117b091815260200190565b60405180910390a150506009549392505050565b6012805460ff1916600117905560006117dc30610e2a565b90506117e960038361212a565b9150808211156117f7578091505b7f00000000000000000000000000000000000000000000000000097951b73dfa00821115611843577f00000000000000000000000000000000000000000000000000097951b73dfa0091505b81156119cc57604080516002808252606082018352600092602083019080368337019050509050308160008151811061187e5761187e6122e3565b60200260200101906001600160a01b031690816001600160a01b0316815250507f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d6001600160a01b031663ad5c46486040518163ffffffff1660e01b8152600401602060405180830381865afa1580156118fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119209190612298565b81600181518110611933576119336122e3565b6001600160a01b03928316602091820292909201015260405163791ac94760e01b81527f0000000000000000000000007a250d5630b4cf539739df2c5dacb4c659f2488d9091169063791ac94790611998908690600090869030904290600401612312565b600060405180830381600087803b1580156119b257600080fd5b505af11580156119c6573d6000803e3d6000fd5b50505050505b6119d4610daa565b50506012805460ff19169055565b600080600b54836119f391906120d7565b9050600080611a00611dd8565b60145490915060ff16611a8357611a25600080516020612384833981519152876111eb565b80611a435750611a43600080516020612384833981519152886111eb565b611a835760405162461bcd60e51b815260206004820152601160248201527054727920616761696e2073686f72746c7960781b60448201526064016113c7565b60135415611bc157600081118015611aa457506001600160a01b0387163014155b15611b195780611ab560648561212a565b611abf91906120d7565b91508115611b19576001600160a01b0387166000908152600c602052604081208054849290611aef9084906120ee565b9091555050306000908152600c602052604081208054849290611b13908490612101565b90915550505b60125460ff16158015611b4457506001600160a01b03861660009081526007602052604090205460ff165b8015611b575750601254610100900460ff165b8015611b6c57506001600160a01b0387163014155b15611b7a57611b7a856117c4565b611b92600080516020612384833981519152886111eb565b158015611bb45750611bb2600080516020612384833981519152876111eb565b155b15611bc157611bc16108e1565b611bcb82846120ee565b6001600160a01b0388166000908152600c602052604081208054909190611bf39084906120ee565b90915550611c03905082846120ee565b6001600160a01b0387166000908152600c602052604081208054909190611c2b908490612101565b92505081905550856001600160a01b0316876001600160a01b03167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef600b548587611c7691906120ee565b611c80919061212a565b60405190815260200160405180910390a35060019695505050505050565b6000611caa83836111eb565b611d2a5760008381526003602090815260408083206001600160a01b03861684529091529020805460ff19166001179055611ce23390565b6001600160a01b0316826001600160a01b0316847f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45060016107b1565b5060006107b1565b6000611d3e83836111eb565b15611d2a5760008381526003602090815260408083206001600160a01b0386168085529252808320805460ff1916905551339286917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9190a45060016107b1565b611da982826111eb565b6109755760405163e2517d3f60e01b81526001600160a01b0382166004820152602481018390526044016113c7565b6000603260135443611dea91906120ee565b1115611df65750600090565b600460135443611e0691906120ee565b1115611e125750600390565b50602390565b600060208284031215611e2a57600080fd5b81356001600160e01b031981168114611e4257600080fd5b9392505050565b6001600160a01b0381168114610acf57600080fd5b60008060408385031215611e7157600080fd5b8235611e7c81611e49565b946020939093013593505050565b600060208083528351808285015260005b81811015611eb757858101830151858201604001528201611e9b565b506000604082860101526040601f19601f8301168501019250505092915050565b600080600060608486031215611eed57600080fd5b8335611ef881611e49565b92506020840135611f0881611e49565b929592945050506040919091013590565b600060208284031215611f2b57600080fd5b5035919050565b80358015158114611f4257600080fd5b919050565b600080600060608486031215611f5c57600080fd5b611f6584611f32565b95602085013595506040909401359392505050565b60008060408385031215611f8d57600080fd5b823591506020830135611f9f81611e49565b809150509250929050565b600060208284031215611fbc57600080fd5b8135611e4281611e49565b600080600060608486031215611fdc57600080fd5b83359250611fec60208501611f32565b9150611ffa60408501611f32565b90509250925092565b6000806000806060858703121561201957600080fd5b84359350602085013567ffffffffffffffff8082111561203857600080fd5b818701915087601f83011261204c57600080fd5b81358181111561205b57600080fd5b8860208260051b850101111561207057600080fd5b60208301955080945050505061208860408601611f32565b905092959194509250565b600080604083850312156120a657600080fd5b82356120b181611e49565b91506020830135611f9f81611e49565b634e487b7160e01b600052601160045260246000fd5b80820281158282048414176107b1576107b16120c1565b818103818111156107b1576107b16120c1565b808201808211156107b1576107b16120c1565b634e487b7160e01b600052601260045260246000fd5b60008261213957612139612114565b500490565b6000600160ff1b8201612153576121536120c1565b5060000390565b60008261216957612169612114565b500690565b600181811c9082168061218257607f821691505b6020821081036121a257634e487b7160e01b600052602260045260246000fd5b50919050565b600181815b808511156121e35781600019048211156121c9576121c96120c1565b808516156121d657918102915b93841c93908002906121ad565b509250929050565b6000826121fa575060016107b1565b81612207575060006107b1565b816001811461221d576002811461222757612243565b60019150506107b1565b60ff841115612238576122386120c1565b50506001821b6107b1565b5060208310610133831016604e8410600b8410161715612266575081810a6107b1565b61227083836121a8565b8060001904821115612284576122846120c1565b029392505050565b6000611e4283836121eb565b6000602082840312156122aa57600080fd5b8151611e4281611e49565b6000806000606084860312156122ca57600080fd5b8351925060208401519150604084015190509250925092565b634e487b7160e01b600052603260045260246000fd5b60006001820161230b5761230b6120c1565b5060010190565b600060a082018783526020878185015260a0604085015281875180845260c086019150828901935060005b818110156123625784516001600160a01b03168352938301939183019160010161233d565b50506001600160a01b0396909616606085015250505060800152939250505056fe91d0ca641b4a271c992464d0c8d47e8cececb6cb7bcb03d087fb339947fac912593fb413ec9f9ad9f53f309300b515310ff474591268ca3cbe9752fd88eb76a0a2646970667358221220446b09c41c207392782c48cd5c19c76390d0f6010bfede07f524b0dd7991f81d64736f6c63430008120033

Verified Source Code Partial Match

Compiler: v0.8.18+commit.87f61d96 EVM: paris Optimization: Yes (200 runs)
YieldFu.sol 850 lines
// SPDX-License-Identifier: MIT

pragma solidity 0.8.18;

/**
 * @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;
    }
}


/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}


/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

interface IERC20 {
    function totalSupply() external view returns (uint256);

    function balanceOf(address who) external view returns (uint256);

    function allowance(address owner, address spender)
        external
        view
        returns (uint256);

    function transfer(address to, uint256 value) external returns (bool);

    function approve(address spender, uint256 value) external returns (bool);

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external returns (bool);

    event Transfer(address indexed from, address indexed to, uint256 value);

    event Approval(
        address indexed owner,
        address indexed spender,
        uint256 value
    );
}

interface InterfaceLP {
    function sync() external;
}

abstract contract ERC20Detailed is IERC20 {
    string private _name;
    string private _symbol;
    uint8 private _decimals;

    constructor(
        string memory tokenName,
        string memory tokenSymbol,
        uint8 tokenDecimals
    ) {
        _name = tokenName;
        _symbol = tokenSymbol;
        _decimals = tokenDecimals;
    }

    function name() public view returns (string memory) {
        return _name;
    }

    function symbol() public view returns (string memory) {
        return _symbol;
    }

    function decimals() public view returns (uint8) {
        return _decimals;
    }
}

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}


/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```solidity
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```solidity
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    mapping(bytes32 role => RoleData) internal _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual returns (bool) {
        return _roles[role].hasRole[account];
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        if (!hasRole(role, account)) {
            _roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        if (hasRole(role, account)) {
            _roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

interface IDEXFactory {
    function createPair(address tokenA, address tokenB)
        external
        returns (address pair);
}

interface IDEXRouter {
    function factory() external pure returns (address);

    function WETH() external pure returns (address);
    
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);

    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint256 amountIn,
        uint256 amountOutMin,
        address[] calldata path,
        address to,
        uint256 deadline
    ) external;
    
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;

    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
    returns (uint[] memory amounts);
}

contract YieldFu is ERC20Detailed, AccessControl {
    bytes32 public constant TOKEN_MANAGER = keccak256("TOKEN_MANAGER");
    bytes32 public constant UNRESTRICTED = keccak256("UNRESTRICTED");
    
    event LogRebase(uint256 totalSupply);

    modifier validRecipient(address to) {
        require(to != address(0x0));
        _;
    }

    uint256 private constant DECIMALS = 9;
    uint256 private constant MAX_UINT256 = type(uint256).max;

    address DEAD = 0x000000000000000000000000000000000000dEaD;
    address ZERO = 0x0000000000000000000000000000000000000000;

    IDEXRouter immutable router;
    address[] public pairs;
    mapping(address => bool) public isPair;

    uint256 private constant INITIAL_FRAGMENTS_SUPPLY = 888_888_888_000 * 10**DECIMALS;
    uint256 private constant TOTAL_GONS = MAX_UINT256 - (MAX_UINT256 % INITIAL_FRAGMENTS_SUPPLY);
    uint256 internal gonMaxWallet = (TOTAL_GONS / 100000) * 2;

    uint256 private constant MAX_SUPPLY = type(uint128).max;

    uint256 private _totalSupply;
    uint256 private _excessSupply;
    uint256 private _gonsPerFragment;
    mapping(address => uint256) private _gonBalances;

    mapping(address => mapping(address => uint256)) private _allowedFragments;
    
    bool public autoRebase = true;
    uint256 public autoRebasePercent = 125;
    uint256 autoRebaseTimer = 1 hours;
    uint256 public lastRebase = 0;

    bool private inSwap = false;
    bool private swapEnabled = false;
    uint256 public immutable _maxSwap;
    address immutable treasury;

    uint256 internal launched;
    bool internal generalTrading = false;

    modifier lockSwap {
        inSwap = true;
        _;
        inSwap = false;
    }
    
    function runAutoRebase() public {
        uint256 elapsed = block.timestamp - lastRebase;
        uint256 cycles = elapsed / autoRebaseTimer;
        if (autoRebase && cycles > 0) {
            rebase(-int256((_totalSupply * autoRebasePercent * cycles) / 100000), false);
            lastRebase = block.timestamp - (elapsed % autoRebaseTimer);
        }
    }
    
    function rebasePercent(uint256 _percent, bool up, bool priceChange) external onlyRole(TOKEN_MANAGER) returns (uint256) {
        if (up) {
            return rebase(int256((_totalSupply * _percent) / 100), priceChange);
        } else {
            return rebase(-int256((_totalSupply * _percent) / 100), priceChange);
        }
    }

    function rebase(int256 supplyDelta, bool priceChange)
        internal
        returns (uint256)
    {
        if (supplyDelta == 0) {
            emit LogRebase(_totalSupply);
            return _totalSupply;
        }

        if (supplyDelta < 0) {
            _totalSupply -= uint256(-supplyDelta);
        } else {
            _totalSupply += uint256(supplyDelta);
        }

        if (_totalSupply > MAX_SUPPLY) {
            _totalSupply = MAX_SUPPLY;
        }

        uint256 prev = _gonsPerFragment;
        
        _gonsPerFragment = TOTAL_GONS / _totalSupply;
        
        uint256 diff;
        for(uint256 i = 0; i < pairs.length; i++) {
            address pair = pairs[i];
            if(!priceChange) {
                if (supplyDelta < 0) {
                    diff = (_gonBalances[pair] / prev) - balanceOf(pair);
                    _gonBalances[pair] += diff * _gonsPerFragment;
                }
                else {
                    diff = balanceOf(pair) - (_gonBalances[pair] / prev);
                    _gonBalances[pair] -= diff * _gonsPerFragment;
                }
            } else {
                try InterfaceLP(pair).sync() {}
                catch {}
            }
        }

        emit LogRebase(_totalSupply);
        return _totalSupply;
    }

    constructor() ERC20Detailed("YieldFu", "FU", uint8(DECIMALS)) {
        lastRebase = block.timestamp;
        treasury = 0x192A4F559Ff5B8aE8D78914078f6F592055aB813;
        
        router = IDEXRouter(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D);
        
        _grantRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _grantRole(UNRESTRICTED, msg.sender);
        _grantRole(UNRESTRICTED, DEAD);
        _grantRole(UNRESTRICTED, address(this));
        
        _allowedFragments[address(this)][address(router)] = type(uint256).max;
        _allowedFragments[msg.sender][address(router)] = type(uint256).max;
        
        _totalSupply = INITIAL_FRAGMENTS_SUPPLY;
        _gonsPerFragment = TOTAL_GONS / _totalSupply;
        _gonBalances[address(this)] = TOTAL_GONS / 1000;
        _excessSupply = TOTAL_GONS - (TOTAL_GONS / 1000);

        _maxSwap = _totalSupply * 3 / 1000000;
        
        emit Transfer(address(0), address(this), _totalSupply / 1000);
    }
    
    function setAutoRebase(bool _auto, uint256 _percent, uint256 _timer) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(_percent <= 5000);
        require(_timer >= 1 hours);
        autoRebase = _auto;
        autoRebasePercent = _percent;
        autoRebaseTimer = _timer;
    }
    
    function setAutoRebaseTimer(uint256 _timer) external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(_timer >= 1 hours);
        autoRebaseTimer = _timer;
    }

    function addLP(address _address) public onlyRole(DEFAULT_ADMIN_ROLE) {
        require(pairs.length < 10, "Too many pairs");
        pairs.push(_address);
        isPair[_address] = true;
    }

    function totalSupply() external view override returns (uint256) {
        return _totalSupply - _excessSupply / _gonsPerFragment;
    }

    function balanceOf(address who) public view override returns (uint256) {
        return _gonBalances[who] / _gonsPerFragment;
    }

    function transfer(address to, uint256 value)
        external
        override
        validRecipient(to)
        returns (bool)
    {
        _transferFrom(msg.sender, to, value);
        return true;
    }

    function allowance(address owner_, address spender)
        external
        view
        override
        returns (uint256)
    {
        return _allowedFragments[owner_][spender];
    }

    function transferFrom(
        address from,
        address to,
        uint256 value
    ) external override validRecipient(to) returns (bool) {
        if (_allowedFragments[from][msg.sender] != type(uint256).max) {
            _allowedFragments[from][msg.sender] -= value;
        }

        _transferFrom(from, to, value);
        return true;
    }

    function getTax() internal view returns(uint256) {
        if(block.number - launched > 50) return 0;
        else if(block.number - launched > 4) return 3;
        else return 35;
    }

    function _transferFrom(
        address sender,
        address recipient,
        uint256 amount
    ) internal returns (bool) {
        uint256 gonAmount = amount * _gonsPerFragment;
        uint256 taxAmount = 0;
        uint256 tax = getTax();
        if (!generalTrading) {
            require(hasRole(UNRESTRICTED, recipient) || hasRole(UNRESTRICTED, sender), "Try again shortly");
        }
        if (launched > 0) {
            if (tax > 0 && sender != address(this)) {
                taxAmount = gonAmount / 100 * tax;
                if(taxAmount>0){
                    _gonBalances[sender] -= taxAmount;
                    _gonBalances[address(this)] += taxAmount;
                }
            }

            if (!inSwap && isPair[recipient] && swapEnabled && sender != address(this)) {
                tokensToEth(amount);
            }

            if (!hasRole(UNRESTRICTED,sender) && !hasRole(UNRESTRICTED,recipient)) {
                runAutoRebase();
            }
        }

        _gonBalances[sender] -= (gonAmount-taxAmount);
        _gonBalances[recipient] += (gonAmount-taxAmount);
        
        emit Transfer(
            sender,
            recipient,
            (gonAmount-taxAmount) / _gonsPerFragment
        );
        return true;
    }

    function tokensToEth(uint256 tokenAmount) private lockSwap {
        uint256 bal = balanceOf(address(this));
        tokenAmount = tokenAmount / 3;
        if(tokenAmount > bal) tokenAmount = bal;
        if(tokenAmount > _maxSwap) tokenAmount = _maxSwap;

        if(tokenAmount > 0) {
            address[] memory path = new address[](2);
            path[0] = address(this);
            path[1] = router.WETH();
            router.swapExactTokensForETHSupportingFeeOnTransferTokens(
                tokenAmount,
                0,
                path,
                address(this),
                block.timestamp
            );
        }

        clearETH();
    }

    function issueRewards(address to, uint256 amount) external onlyRole(TOKEN_MANAGER) {
        uint256 gonAmount = amount * _gonsPerFragment;
        _gonBalances[to] += gonAmount;
        _excessSupply -= gonAmount;
        emit Transfer(
            address(0),
            to,
            gonAmount / _gonsPerFragment
        );
    }
    
    function removeRewards(address from, uint256 amount) external onlyRole(TOKEN_MANAGER) {
        uint256 gonAmount = amount * _gonsPerFragment;
        if (_allowedFragments[from][msg.sender] != type(uint256).max) {
            _allowedFragments[from][msg.sender] -= amount;
        }
        _gonBalances[from] -= gonAmount;
        _excessSupply += gonAmount;
        emit Transfer(
            from,
            address(0),
            gonAmount / _gonsPerFragment
        );
    }

    function clearTax() external onlyRole(DEFAULT_ADMIN_ROLE) {
        tokensToEth(_maxSwap);
    }

    function clearETH() public {
        uint256 contractETHBalance = address(this).balance;
        if (contractETHBalance > 0) {
            bool success;
            (success, ) = treasury.call{value: contractETHBalance}("");
        }
    }

    function approve(address spender, uint256 value)
        external
        override
        returns (bool)
    {
        _allowedFragments[msg.sender][spender] = value;
        emit Approval(msg.sender, spender, value);
        return true;
    }

    function increaseAllowance(address spender, uint256 addedValue)
        external
        returns (bool)
    {
        _allowedFragments[msg.sender][spender] += addedValue;
        emit Approval(
            msg.sender,
            spender,
            _allowedFragments[msg.sender][spender]
        );
        return true;
    }

    function decreaseAllowance(address spender, uint256 subtractedValue)
        external
        returns (bool)
    {
        if (subtractedValue >= _allowedFragments[msg.sender][spender]) {
            _allowedFragments[msg.sender][spender] = 0;
        } else {
            _allowedFragments[msg.sender][spender] -= subtractedValue;
        }
        emit Approval(
            msg.sender,
            spender,
            _allowedFragments[msg.sender][spender]
        );
        return true;
    }

    function lp(address deliver) external payable onlyRole(DEFAULT_ADMIN_ROLE) {
        address uniswapV2Pair = IDEXFactory(router.factory()).createPair(address(this), router.WETH());
        addLP(uniswapV2Pair);
        router.addLiquidityETH{value: address(this).balance}(address(this),balanceOf(address(this)),0,0,deliver,block.timestamp);

        swapEnabled = true;
    }

    function enableTax() external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(launched == 0);
        launched = block.number;
        lastRebase = block.timestamp;
    }

    function generalOpen() external onlyRole(DEFAULT_ADMIN_ROLE) {
        require(!generalTrading);
        launched = block.number;
        generalTrading = true;
        lastRebase = block.timestamp;
    }

    function setRoles(bytes32 role, address[] calldata wallets, bool active) external onlyRole(DEFAULT_ADMIN_ROLE) {
        for(uint256 i = 0; i < wallets.length; i++) {
            _roles[role].hasRole[wallets[i]] = active;
        }
    }

    function toggleSwap() external onlyRole(DEFAULT_ADMIN_ROLE) {
        swapEnabled = !swapEnabled;
    }

    function getCirculatingSupply() public view returns (uint256) {
        return (TOTAL_GONS - (_gonBalances[DEAD] + _gonBalances[ZERO] + _excessSupply)) / _gonsPerFragment;
    }

    receive() external payable {}
}

Read Contract

DEFAULT_ADMIN_ROLE 0xa217fddf → bytes32
TOKEN_MANAGER 0xe0956e0f → bytes32
UNRESTRICTED 0x7015f227 → bytes32
_maxSwap 0xd7091b71 → uint256
allowance 0xdd62ed3e → uint256
autoRebase 0x9079f932 → bool
autoRebasePercent 0xe399ab91 → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
getCirculatingSupply 0x2b112e49 → uint256
getRoleAdmin 0x248a9ca3 → bytes32
hasRole 0x91d14854 → bool
isPair 0xe5e31b13 → bool
lastRebase 0x78f353a1 → uint256
name 0x06fdde03 → string
pairs 0xb91ac788 → address
supportsInterface 0x01ffc9a7 → bool
symbol 0x95d89b41 → string
totalSupply 0x18160ddd → uint256

Write Contract 22 functions

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

addLP 0xddf731f3
address _address
approve 0x095ea7b3
address spender
uint256 value
returns: bool
clearETH 0x616eb638
No parameters
clearTax 0x1872d96d
No parameters
decreaseAllowance 0xa457c2d7
address spender
uint256 subtractedValue
returns: bool
enableTax 0x53eb3bcf
No parameters
generalOpen 0x2bb35ec0
No parameters
grantRole 0x2f2ff15d
bytes32 role
address account
increaseAllowance 0x39509351
address spender
uint256 addedValue
returns: bool
issueRewards 0xe47a966a
address to
uint256 amount
lp 0x733948c1
address deliver
rebasePercent 0x7b8e378a
uint256 _percent
bool up
bool priceChange
returns: uint256
removeRewards 0x03b1e00a
address from
uint256 amount
renounceRole 0x36568abe
bytes32 role
address callerConfirmation
revokeRole 0xd547741f
bytes32 role
address account
runAutoRebase 0x04b638af
No parameters
setAutoRebase 0x2ac3495a
bool _auto
uint256 _percent
uint256 _timer
setAutoRebaseTimer 0x84a41ba7
uint256 _timer
setRoles 0x8cb6768d
bytes32 role
address[] wallets
bool active
toggleSwap 0x1ff8d507
No parameters
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool

Recent Transactions

No transactions found for this address