Address Contract Partially Verified
Address
0xA565E73431c1AFCed670DC6Dd13a4956b62f30aB
Balance
0 ETH
Nonce
1
Code Size
14705 bytes
Creator
0x6c598450...8bEa at tx 0x84b4b092...8f2f5e
Indexed Transactions
0
Contract Bytecode
14705 bytes
0x60806040526004361061010d5760003560e01c80638456cb5911610095578063c7753be811610064578063c7753be814610326578063f242862114610342578063f25f4b561461036d578063f2fde38b14610398578063fcd4efd0146103c157610114565b80638456cb59146102925780638da5cb5b146102a95780638f01f9d1146102d45780639378f2e1146102fd57610114565b8063540eee27116100dc578063540eee27146101ad5780635c975abb146101ea578063715018a6146102155780637aa51fd61461022c5780637b72a0451461026957610114565b80633f138d4b146101195780633f4ba83a14610142578063404ea1bd146101595780634f258ad91461018457610114565b3661011457005b600080fd5b34801561012557600080fd5b50610140600480360381019061013b9190612b1f565b6103ea565b005b34801561014e57600080fd5b5061015761045a565b005b34801561016557600080fd5b5061016e61046c565b60405161017b9190612f5b565b60405180910390f35b34801561019057600080fd5b506101ab60048036038101906101a69190612a91565b610492565b005b3480156101b957600080fd5b506101d460048036038101906101cf9190612a91565b6104f5565b6040516101e1919061306e565b60405180910390f35b3480156101f657600080fd5b506101ff610515565b60405161020c919061306e565b60405180910390f35b34801561022157600080fd5b5061022a61052c565b005b34801561023857600080fd5b50610253600480360381019061024e9190612a91565b610540565b604051610260919061306e565b60405180910390f35b34801561027557600080fd5b50610290600480360381019061028b9190612a91565b610560565b005b34801561029e57600080fd5b506102a76105c3565b005b3480156102b557600080fd5b506102be6105d5565b6040516102cb9190612f5b565b60405180910390f35b3480156102e057600080fd5b506102fb60048036038101906102f69190612ae3565b6105fe565b005b34801561030957600080fd5b50610324600480360381019061031f9190612a91565b61068c565b005b610340600480360381019061033b9190612b84565b6106ef565b005b34801561034e57600080fd5b50610357611d5d565b6040516103649190612f5b565b60405180910390f35b34801561037957600080fd5b50610382611d83565b60405161038f9190612f5b565b60405180910390f35b3480156103a457600080fd5b506103bf60048036038101906103ba9190612a91565b611da9565b005b3480156103cd57600080fd5b506103e860048036038101906103e39190612a91565b611e2d565b005b6103f2611e90565b61041d33828473ffffffffffffffffffffffffffffffffffffffff16611f0e9092919063ffffffff16565b7f74545154aac348a3eac92596bd1971957ca94795f4e954ec5f613b55fab78129828260405161044e929190613045565b60405180910390a15050565b610462611e90565b61046a611f94565b565b600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61049a611e90565b6000600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b60046020528060005260406000206000915054906101000a900460ff1681565b6000600260009054906101000a900460ff16905090565b610534611e90565b61053e6000611ff7565b565b60036020528060005260406000206000915054906101000a900460ff1681565b610568611e90565b6000600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6105cb611e90565b6105d36120bb565b565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b610606611e90565b81600560006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555080600660006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505050565b610694611e90565b6001600360008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b6106f761211e565b6106ff61216e565b600281806000019061071191906132a6565b9050111580156107335750600181806000019061072e91906132a6565b905010155b610772576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610769906130ab565b60405180910390fd5b600681806020019061078491906132fd565b9050106107c6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016107bd9061314b565b60405180910390fd5b61080933308360a001358460c00160208101906107e39190612a91565b73ffffffffffffffffffffffffffffffffffffffff166121b8909392919063ffffffff16565b600360008260400160000160208101906108239190612a91565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff166108aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016108a1906131cb565b60405180910390fd5b6109768160c00160208101906108c09190612a91565b8260400160000160208101906108d69190612a91565b8360c00160208101906108e99190612a91565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016109219190612f5b565b60206040518083038186803b15801561093957600080fd5b505afa15801561094d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109719190612bc5565b612241565b60008160c001602081019061098b9190612a91565b73ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156109d057600080fd5b505afa1580156109e4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a089190612aba565b905060008260c0016020810190610a1f9190612a91565b73ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015610a6457600080fd5b505afa158015610a78573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a9c9190612aba565b9050826040016000016020810190610ab49190612a91565b73ffffffffffffffffffffffffffffffffffffffff1663baa2abde83838660c0016020810190610ae49190612a91565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610b1c9190612f5b565b60206040518083038186803b158015610b3457600080fd5b505afa158015610b48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b6c9190612bc5565b87604001602001358860400160400135307fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff6040518863ffffffff1660e01b8152600401610bc09796959493929190612fd6565b6040805180830381600087803b158015610bd957600080fd5b505af1158015610bed573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c119190612bee565b505060005b838060200190610c2691906132fd565b90508110156110895760036000858060200190610c4391906132fd565b84818110610c7a577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002810190610c8c91906133ab565b6020016020810190610c9e9190612a91565b73ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16610d25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d1c9061312b565b60405180910390fd5b610ef6848060200190610d3891906132fd565b83818110610d6f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002810190610d8191906133ab565b6000016020810190610d939190612a91565b858060200190610da391906132fd565b84818110610dda577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002810190610dec91906133ab565b6020016020810190610dfe9190612a91565b868060200190610e0e91906132fd565b85818110610e45577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002810190610e5791906133ab565b6000016020810190610e699190612a91565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610ea19190612f5b565b60206040518083038186803b158015610eb957600080fd5b505afa158015610ecd573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ef19190612bc5565b612241565b6000848060200190610f0891906132fd565b83818110610f3f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002810190610f5191906133ab565b6020016020810190610f639190612a91565b73ffffffffffffffffffffffffffffffffffffffff16858060200190610f8991906132fd565b84818110610fc0577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002810190610fd291906133ab565b8060400190610fe19190613354565b604051610fef929190612f16565b6000604051808303816000865af19150503d806000811461102c576040519150601f19603f3d011682016040523d82523d6000602084013e611031565b606091505b5050905080611075576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161106c906130eb565b60405180910390fd5b50808061108190613516565b915050610c16565b5060005b83806000019061109d91906132a6565b90508110156112a257600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168480600001906110ef91906132a6565b83818110611126577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b905060200201602081019061113b9190612a91565b73ffffffffffffffffffffffffffffffffffffffff16141561128f57600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16632e1a7d4d600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016111f09190612f5b565b60206040518083038186803b15801561120857600080fd5b505afa15801561121c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906112409190612bc5565b6040518263ffffffff1660e01b815260040161125c919061328b565b600060405180830381600087803b15801561127657600080fd5b505af115801561128a573d6000803e3d6000fd5b505050505b808061129a90613516565b91505061108d565b50600460003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff1661170a576000600660009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff166356c5f349336040518263ffffffff1660e01b81526004016113519190612f5b565b60206040518083038186803b15801561136957600080fd5b505afa15801561137d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906113a19190612bc5565b9050600081146117085760028480600001906113bd91906132a6565b905014156115f2576114d98480600001906113d891906132a6565b6000818110611410577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906114259190612a91565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166114d46127106114c6866114b88b806000019061146591906132a6565b600081811061149d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906114b29190612a91565b30612360565b61246990919063ffffffff16565b61247f90919063ffffffff16565b612495565b6115ed8480600001906114ec91906132a6565b6001818110611524577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906115399190612a91565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166115e86127106115da866115cc8b806000019061157991906132a6565b60018181106115b1577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906115c69190612a91565b30612360565b61246990919063ffffffff16565b61247f90919063ffffffff16565b612495565b611707565b61170684806000019061160591906132a6565b600081811061163d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906116529190612a91565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff166117016127106116f3866116e58b806000019061169291906132a6565b60008181106116ca577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b90506020020160208101906116df9190612a91565b30612360565b61246990919063ffffffff16565b61247f90919063ffffffff16565b612495565b5b5b505b60008360c001602081019061171f9190612a91565b73ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b15801561176457600080fd5b505afa158015611778573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179c9190612aba565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016117d49190612f5b565b60206040518083038186803b1580156117ec57600080fd5b505afa158015611800573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118249190612bc5565b905060008460c001602081019061183b9190612a91565b73ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b15801561188057600080fd5b505afa158015611894573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906118b89190612aba565b73ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016118f09190612f5b565b60206040518083038186803b15801561190857600080fd5b505afa15801561191c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119409190612bc5565b90506000821115611a0657611a0533838760c00160208101906119639190612a91565b73ffffffffffffffffffffffffffffffffffffffff16630dfe16816040518163ffffffff1660e01b815260040160206040518083038186803b1580156119a857600080fd5b505afa1580156119bc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119e09190612aba565b73ffffffffffffffffffffffffffffffffffffffff16611f0e9092919063ffffffff16565b5b6000811115611aca57611ac933828760c0016020810190611a279190612a91565b73ffffffffffffffffffffffffffffffffffffffff1663d21220a76040518163ffffffff1660e01b815260040160206040518083038186803b158015611a6c57600080fd5b505afa158015611a80573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611aa49190612aba565b73ffffffffffffffffffffffffffffffffffffffff16611f0e9092919063ffffffff16565b5b6002858060000190611adc91906132a6565b90501415611c8157611bb0858060000190611af791906132a6565b6000818110611b2f577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190611b449190612a91565b33611bab888060000190611b5891906132a6565b6000818110611b90577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190611ba59190612a91565b30612360565b612495565b611c7c858060000190611bc391906132a6565b6001818110611bfb577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190611c109190612a91565b33611c77888060000190611c2491906132a6565b6001818110611c5c577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190611c719190612a91565b30612360565b612495565b611d4e565b611d4d858060000190611c9491906132a6565b6000818110611ccc577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190611ce19190612a91565b33611d48888060000190611cf591906132a6565b6000818110611d2d577f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b9050602002016020810190611d429190612a91565b30612360565b612495565b5b50505050611d5a6125d8565b50565b600860009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b600560009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b611db1611e90565b600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161415611e21576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611e189061310b565b60405180910390fd5b611e2a81611ff7565b50565b611e35611e90565b6001600460008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff02191690831515021790555050565b611e986125e1565b73ffffffffffffffffffffffffffffffffffffffff16611eb66105d5565b73ffffffffffffffffffffffffffffffffffffffff1614611f0c576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f03906131ab565b60405180910390fd5b565b611f8f8363a9059cbb60e01b8484604051602401611f2d929190613045565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506125e9565b505050565b611f9c6126b0565b6000600260006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa611fe06125e1565b604051611fed9190612f5b565b60405180910390a1565b60008060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050816000806101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b6120c361216e565b6001600260006101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586121076125e1565b6040516121149190612f5b565b60405180910390a1565b60026001541415612164576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161215b9061324b565b60405180910390fd5b6002600181905550565b612176610515565b156121b6576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016121ad9061318b565b60405180910390fd5b565b61223b846323b872dd60e01b8585856040516024016121d993929190612f9f565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506125e9565b50505050565b60008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b815260040161227e929190612f76565b60206040518083038186803b15801561229657600080fd5b505afa1580156122aa573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906122ce9190612bc5565b90508181101561235a57600081111561230e5761230d8360008673ffffffffffffffffffffffffffffffffffffffff166126f99092919063ffffffff16565b5b612359837fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8673ffffffffffffffffffffffffffffffffffffffff166126f99092919063ffffffff16565b5b50505050565b6000600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156123d7578173ffffffffffffffffffffffffffffffffffffffff16319050612463565b8273ffffffffffffffffffffffffffffffffffffffff166370a08231836040518263ffffffff1660e01b81526004016124109190612f5b565b60206040518083038186803b15801561242857600080fd5b505afa15801561243c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906124609190612bc5565b90505b92915050565b600081836124779190613432565b905092915050565b6000818361248d9190613401565b905092915050565b60008111156125d357600760009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1614156125a65760008273ffffffffffffffffffffffffffffffffffffffff168260405161251a90612f46565b60006040518083038185875af1925050503d8060008114612557576040519150601f19603f3d011682016040523d82523d6000602084013e61255c565b606091505b50509050806125a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612597906131eb565b60405180910390fd5b506125d2565b6125d182828573ffffffffffffffffffffffffffffffffffffffff16611f0e9092919063ffffffff16565b5b5b505050565b60018081905550565b600033905090565b600061264b826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c65648152508573ffffffffffffffffffffffffffffffffffffffff166128579092919063ffffffff16565b90506000815111156126ab578080602001905181019061266b9190612b5b565b6126aa576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126a19061322b565b60405180910390fd5b5b505050565b6126b8610515565b6126f7576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016126ee906130cb565b60405180910390fd5b565b6000811480612792575060008373ffffffffffffffffffffffffffffffffffffffff1663dd62ed3e30856040518363ffffffff1660e01b8152600401612740929190612f76565b60206040518083038186803b15801561275857600080fd5b505afa15801561276c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127909190612bc5565b145b6127d1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016127c89061326b565b60405180910390fd5b6128528363095ea7b360e01b84846040516024016127f0929190613045565b604051602081830303815290604052907bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19166020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506125e9565b505050565b6060612866848460008561286f565b90509392505050565b6060824710156128b4576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128ab9061316b565b60405180910390fd5b6128bd85612983565b6128fc576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128f39061320b565b60405180910390fd5b6000808673ffffffffffffffffffffffffffffffffffffffff1685876040516129259190612f2f565b60006040518083038185875af1925050503d8060008114612962576040519150601f19603f3d011682016040523d82523d6000602084013e612967565b606091505b50915091506129778282866129a6565b92505050949350505050565b6000808273ffffffffffffffffffffffffffffffffffffffff163b119050919050565b606083156129b657829050612a06565b6000835111156129c95782518084602001fd5b816040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016129fd9190613089565b60405180910390fd5b9392505050565b600081359050612a1c816138f6565b92915050565b600081519050612a31816138f6565b92915050565b600081519050612a468161390d565b92915050565b600060e08284031215612a5e57600080fd5b81905092915050565b600081359050612a7681613924565b92915050565b600081519050612a8b81613924565b92915050565b600060208284031215612aa357600080fd5b6000612ab184828501612a0d565b91505092915050565b600060208284031215612acc57600080fd5b6000612ada84828501612a22565b91505092915050565b60008060408385031215612af657600080fd5b6000612b0485828601612a0d565b9250506020612b1585828601612a0d565b9150509250929050565b60008060408385031215612b3257600080fd5b6000612b4085828601612a0d565b9250506020612b5185828601612a67565b9150509250929050565b600060208284031215612b6d57600080fd5b6000612b7b84828501612a37565b91505092915050565b600060208284031215612b9657600080fd5b600082013567ffffffffffffffff811115612bb057600080fd5b612bbc84828501612a4c565b91505092915050565b600060208284031215612bd757600080fd5b6000612be584828501612a7c565b91505092915050565b60008060408385031215612c0157600080fd5b6000612c0f85828601612a7c565b9250506020612c2085828601612a7c565b9150509250929050565b612c338161348c565b82525050565b612c428161349e565b82525050565b6000612c5483856133e5565b9350612c618385846134d4565b82840190509392505050565b6000612c78826133cf565b612c8281856133e5565b9350612c928185602086016134e3565b80840191505092915050565b6000612ca9826133da565b612cb381856133f0565b9350612cc38185602086016134e3565b612ccc816135bd565b840191505092915050565b6000612ce46013836133f0565b9150612cef826135ce565b602082019050919050565b6000612d076014836133f0565b9150612d12826135f7565b602082019050919050565b6000612d2a600b836133f0565b9150612d3582613620565b602082019050919050565b6000612d4d6026836133f0565b9150612d5882613649565b604082019050919050565b6000612d70601b836133f0565b9150612d7b82613698565b602082019050919050565b6000612d936016836133f0565b9150612d9e826136c1565b602082019050919050565b6000612db66026836133f0565b9150612dc1826136ea565b604082019050919050565b6000612dd96010836133f0565b9150612de482613739565b602082019050919050565b6000612dfc6020836133f0565b9150612e0782613762565b602082019050919050565b6000612e1f602b836133f0565b9150612e2a8261378b565b604082019050919050565b6000612e426000836133e5565b9150612e4d826137da565b600082019050919050565b6000612e656010836133f0565b9150612e70826137dd565b602082019050919050565b6000612e88601d836133f0565b9150612e9382613806565b602082019050919050565b6000612eab602a836133f0565b9150612eb68261382f565b604082019050919050565b6000612ece601f836133f0565b9150612ed98261387e565b602082019050919050565b6000612ef16036836133f0565b9150612efc826138a7565b604082019050919050565b612f10816134ca565b82525050565b6000612f23828486612c48565b91508190509392505050565b6000612f3b8284612c6d565b915081905092915050565b6000612f5182612e35565b9150819050919050565b6000602082019050612f706000830184612c2a565b92915050565b6000604082019050612f8b6000830185612c2a565b612f986020830184612c2a565b9392505050565b6000606082019050612fb46000830186612c2a565b612fc16020830185612c2a565b612fce6040830184612f07565b949350505050565b600060e082019050612feb600083018a612c2a565b612ff86020830189612c2a565b6130056040830188612f07565b6130126060830187612f07565b61301f6080830186612f07565b61302c60a0830185612c2a565b61303960c0830184612f07565b98975050505050505050565b600060408201905061305a6000830185612c2a565b6130676020830184612f07565b9392505050565b60006020820190506130836000830184612c39565b92915050565b600060208201905081810360008301526130a38184612c9e565b905092915050565b600060208201905081810360008301526130c481612cd7565b9050919050565b600060208201905081810360008301526130e481612cfa565b9050919050565b6000602082019050818103600083015261310481612d1d565b9050919050565b6000602082019050818103600083015261312481612d40565b9050919050565b6000602082019050818103600083015261314481612d63565b9050919050565b6000602082019050818103600083015261316481612d86565b9050919050565b6000602082019050818103600083015261318481612da9565b9050919050565b600060208201905081810360008301526131a481612dcc565b9050919050565b600060208201905081810360008301526131c481612def565b9050919050565b600060208201905081810360008301526131e481612e12565b9050919050565b6000602082019050818103600083015261320481612e58565b9050919050565b6000602082019050818103600083015261322481612e7b565b9050919050565b6000602082019050818103600083015261324481612e9e565b9050919050565b6000602082019050818103600083015261326481612ec1565b9050919050565b6000602082019050818103600083015261328481612ee4565b9050919050565b60006020820190506132a06000830184612f07565b92915050565b600080833560016020038436030381126132bf57600080fd5b80840192508235915067ffffffffffffffff8211156132dd57600080fd5b6020830192506020820236038313156132f557600080fd5b509250929050565b6000808335600160200384360303811261331657600080fd5b80840192508235915067ffffffffffffffff82111561333457600080fd5b60208301925060208202360383131561334c57600080fd5b509250929050565b6000808335600160200384360303811261336d57600080fd5b80840192508235915067ffffffffffffffff82111561338b57600080fd5b6020830192506001820236038313156133a357600080fd5b509250929050565b6000823560016060038336030381126133c357600080fd5b80830191505092915050565b600081519050919050565b600081519050919050565b600081905092915050565b600082825260208201905092915050565b600061340c826134ca565b9150613417836134ca565b9250826134275761342661358e565b5b828204905092915050565b600061343d826134ca565b9150613448836134ca565b9250817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156134815761348061355f565b5b828202905092915050565b6000613497826134aa565b9050919050565b60008115159050919050565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b6000819050919050565b82818337600083830152505050565b60005b838110156135015780820151818401526020810190506134e6565b83811115613510576000848401525b50505050565b6000613521826134ca565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8214156135545761355361355f565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b6000601f19601f8301169050919050565b7f4d61782032206f757470757420746f6b656e7300000000000000000000000000600082015250565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b7f53776170206661696c6564000000000000000000000000000000000000000000600082015250565b7f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160008201527f6464726573730000000000000000000000000000000000000000000000000000602082015250565b7f5377617020726f75746572206e6f742077686974656c69737465640000000000600082015250565b7f4572726f72202d20746f6f206d616e7920737761707300000000000000000000600082015250565b7f416464726573733a20696e73756666696369656e742062616c616e636520666f60008201527f722063616c6c0000000000000000000000000000000000000000000000000000602082015250565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b7f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572600082015250565b7f4572726f72202d204c697175696469747920726f75746572206973206e6f742060008201527f77686974656c6973746564000000000000000000000000000000000000000000602082015250565b50565b7f5472616e73666572206661696c65642e00000000000000000000000000000000600082015250565b7f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000600082015250565b7f5361666545524332303a204552433230206f7065726174696f6e20646964206e60008201527f6f74207375636365656400000000000000000000000000000000000000000000602082015250565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b7f5361666545524332303a20617070726f76652066726f6d206e6f6e2d7a65726f60008201527f20746f206e6f6e2d7a65726f20616c6c6f77616e636500000000000000000000602082015250565b6138ff8161348c565b811461390a57600080fd5b50565b6139168161349e565b811461392157600080fd5b50565b61392d816134ca565b811461393857600080fd5b5056fea26469706673582212202d99d34ec50eaaf5d1f88099ada81788483588d77929c5d5447ac57ab8a8e3d364736f6c63430008040033
Verified Source Code Partial Match
Compiler: v0.8.4+commit.c7e474f2
EVM: istanbul
Optimization: No
LiquidusAutoLPFarmOut.sol 1598 lines
// SPDX-License-Identifier: UNLICENSED
// File: @openzeppelin/contracts/utils/math/SafeMath.sol
// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)
pragma solidity ^0.8.0;
// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.
/**
* @dev Wrappers over Solidity's arithmetic operations.
*
* NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
* now has built in overflow checking.
*/
library SafeMath {
/**
* @dev Returns the addition of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
uint256 c = a + b;
if (c < a) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the subtraction of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b > a) return (false, 0);
return (true, a - b);
}
}
/**
* @dev Returns the multiplication of two unsigned integers, with an overflow flag.
*
* _Available since v3.4._
*/
function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
// Gas optimization: this is cheaper than requiring 'a' not being zero, but the
// benefit is lost if 'b' is also tested.
// See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
if (a == 0) return (true, 0);
uint256 c = a * b;
if (c / a != b) return (false, 0);
return (true, c);
}
}
/**
* @dev Returns the division of two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a / b);
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
*
* _Available since v3.4._
*/
function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
unchecked {
if (b == 0) return (false, 0);
return (true, a % b);
}
}
/**
* @dev Returns the addition of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `+` operator.
*
* Requirements:
*
* - Addition cannot overflow.
*/
function add(uint256 a, uint256 b) internal pure returns (uint256) {
return a + b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b) internal pure returns (uint256) {
return a - b;
}
/**
* @dev Returns the multiplication of two unsigned integers, reverting on
* overflow.
*
* Counterpart to Solidity's `*` operator.
*
* Requirements:
*
* - Multiplication cannot overflow.
*/
function mul(uint256 a, uint256 b) internal pure returns (uint256) {
return a * b;
}
/**
* @dev Returns the integer division of two unsigned integers, reverting on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator.
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(uint256 a, uint256 b) internal pure returns (uint256) {
return a / b;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting when dividing by zero.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(uint256 a, uint256 b) internal pure returns (uint256) {
return a % b;
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {trySub}.
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
*
* - Subtraction cannot overflow.
*/
function sub(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b <= a, errorMessage);
return a - b;
}
}
/**
* @dev Returns the integer division of two unsigned integers, reverting with custom message on
* division by zero. The result is rounded towards zero.
*
* Counterpart to Solidity's `/` operator. Note: this function uses a
* `revert` opcode (which leaves remaining gas untouched) while Solidity
* uses an invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function div(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a / b;
}
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* reverting with custom message when dividing by zero.
*
* CAUTION: This function is deprecated because it requires allocating memory for the error
* message unnecessarily. For custom revert reasons use {tryMod}.
*
* Counterpart to Solidity's `%` operator. This function uses a `revert`
* opcode (which leaves remaining gas untouched) while Solidity uses an
* invalid opcode to revert (consuming all remaining gas).
*
* Requirements:
*
* - The divisor cannot be zero.
*/
function mod(
uint256 a,
uint256 b,
string memory errorMessage
) internal pure returns (uint256) {
unchecked {
require(b > 0, errorMessage);
return a % b;
}
}
}
// File: @openzeppelin/contracts/security/ReentrancyGuard.sol
// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module that helps prevent reentrant calls to a function.
*
* Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
* available, which can be applied to functions to make sure there are no nested
* (reentrant) calls to them.
*
* Note that because there is a single `nonReentrant` guard, functions marked as
* `nonReentrant` may not call one another. This can be worked around by making
* those functions `private`, and then adding `external` `nonReentrant` entry
* points to them.
*
* TIP: If you would like to learn more about reentrancy and alternative ways
* to protect against it, check out our blog post
* https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
*/
abstract contract ReentrancyGuard {
// Booleans are more expensive than uint256 or any type that takes up a full
// word because each write operation emits an extra SLOAD to first read the
// slot's contents, replace the bits taken up by the boolean, and then write
// back. This is the compiler's defense against contract upgrades and
// pointer aliasing, and it cannot be disabled.
// The values being non-zero value makes deployment a bit more expensive,
// but in exchange the refund on every call to nonReentrant will be lower in
// amount. Since refunds are capped to a percentage of the total
// transaction's gas, it is best to keep them low in cases like this one, to
// increase the likelihood of the full refund coming into effect.
uint256 private constant _NOT_ENTERED = 1;
uint256 private constant _ENTERED = 2;
uint256 private _status;
constructor() {
_status = _NOT_ENTERED;
}
/**
* @dev Prevents a contract from calling itself, directly or indirectly.
* Calling a `nonReentrant` function from another `nonReentrant`
* function is not supported. It is possible to prevent this from happening
* by making the `nonReentrant` function external, and making it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
_nonReentrantBefore();
_;
_nonReentrantAfter();
}
function _nonReentrantBefore() private {
// On the first call to nonReentrant, _status will be _NOT_ENTERED
require(_status != _ENTERED, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_status = _ENTERED;
}
function _nonReentrantAfter() private {
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_status = _NOT_ENTERED;
}
}
// File: @openzeppelin/contracts/utils/Address.sol
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)
pragma solidity ^0.8.1;
/**
* @dev Collection of functions related to the address type
*/
library Address {
/**
* @dev Returns true if `account` is a contract.
*
* [IMPORTANT]
* ====
* It is unsafe to assume that an address for which this function returns
* false is an externally-owned account (EOA) and not a contract.
*
* Among others, `isContract` will return false for the following
* types of addresses:
*
* - an externally-owned account
* - a contract in construction
* - an address where a contract will be created
* - an address where a contract lived, but was destroyed
* ====
*
* [IMPORTANT]
* ====
* You shouldn't rely on `isContract` to protect against flash loan attacks!
*
* Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
* like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
* constructor.
* ====
*/
function isContract(address account) internal view returns (bool) {
// This method relies on extcodesize/address.code.length, which returns 0
// for contracts in construction, since the code is only stored at the end
// of the constructor execution.
return account.code.length > 0;
}
/**
* @dev Replacement for Solidity's `transfer`: sends `amount` wei to
* `recipient`, forwarding all available gas and reverting on errors.
*
* https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
* of certain opcodes, possibly making contracts go over the 2300 gas limit
* imposed by `transfer`, making them unable to receive funds via
* `transfer`. {sendValue} removes this limitation.
*
* https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
*
* IMPORTANT: because control is transferred to `recipient`, care must be
* taken to not create reentrancy vulnerabilities. Consider using
* {ReentrancyGuard} or the
* https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
*/
function sendValue(address payable recipient, uint256 amount) internal {
require(address(this).balance >= amount, "Address: insufficient balance");
(bool success, ) = recipient.call{value: amount}("");
require(success, "Address: unable to send value, recipient may have reverted");
}
/**
* @dev Performs a Solidity function call using a low level `call`. A
* plain `call` is an unsafe replacement for a function call: use this
* function instead.
*
* If `target` reverts with a revert reason, it is bubbled up by this
* function (like regular Solidity function calls).
*
* Returns the raw returned data. To convert to the expected return value,
* use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
*
* Requirements:
*
* - `target` must be a contract.
* - calling `target` with `data` must not revert.
*
* _Available since v3.1._
*/
function functionCall(address target, bytes memory data) internal returns (bytes memory) {
return functionCall(target, data, "Address: low-level call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
* `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
return functionCallWithValue(target, data, 0, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but also transferring `value` wei to `target`.
*
* Requirements:
*
* - the calling contract must have an ETH balance of at least `value`.
* - the called Solidity function must be `payable`.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value
) internal returns (bytes memory) {
return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
}
/**
* @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
* with `errorMessage` as a fallback revert reason when `target` reverts.
*
* _Available since v3.1._
*/
function functionCallWithValue(
address target,
bytes memory data,
uint256 value,
string memory errorMessage
) internal returns (bytes memory) {
require(address(this).balance >= value, "Address: insufficient balance for call");
require(isContract(target), "Address: call to non-contract");
(bool success, bytes memory returndata) = target.call{value: value}(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
return functionStaticCall(target, data, "Address: low-level static call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a static call.
*
* _Available since v3.3._
*/
function functionStaticCall(
address target,
bytes memory data,
string memory errorMessage
) internal view returns (bytes memory) {
require(isContract(target), "Address: static call to non-contract");
(bool success, bytes memory returndata) = target.staticcall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
return functionDelegateCall(target, data, "Address: low-level delegate call failed");
}
/**
* @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
* but performing a delegate call.
*
* _Available since v3.4._
*/
function functionDelegateCall(
address target,
bytes memory data,
string memory errorMessage
) internal returns (bytes memory) {
require(isContract(target), "Address: delegate call to non-contract");
(bool success, bytes memory returndata) = target.delegatecall(data);
return verifyCallResult(success, returndata, errorMessage);
}
/**
* @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
* revert reason using the provided one.
*
* _Available since v4.3._
*/
function verifyCallResult(
bool success,
bytes memory returndata,
string memory errorMessage
) internal pure returns (bytes memory) {
if (success) {
return returndata;
} else {
// Look for revert reason and bubble it up if present
if (returndata.length > 0) {
// The easiest way to bubble the revert reason is using memory via assembly
/// @solidity memory-safe-assembly
assembly {
let returndata_size := mload(returndata)
revert(add(32, returndata), returndata_size)
}
} else {
revert(errorMessage);
}
}
}
}
// File: @openzeppelin/contracts/token/ERC20/extensions/draft-IERC20Permit.sol
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)
pragma solidity ^0.8.0;
/**
* @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
* https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
*
* Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
* presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
* need to send a transaction, and thus is not required to hold Ether at all.
*/
interface IERC20Permit {
/**
* @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
* given ``owner``'s signed approval.
*
* IMPORTANT: The same issues {IERC20-approve} has related to transaction
* ordering also apply here.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `spender` cannot be the zero address.
* - `deadline` must be a timestamp in the future.
* - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
* over the EIP712-formatted function arguments.
* - the signature must use ``owner``'s current nonce (see {nonces}).
*
* For more information on the signature format, see the
* https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
* section].
*/
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
/**
* @dev Returns the current nonce for `owner`. This value must be
* included whenever a signature is generated for {permit}.
*
* Every successful call to {permit} increases ``owner``'s nonce by one. This
* prevents a signature from being used multiple times.
*/
function nonces(address owner) external view returns (uint256);
/**
* @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
*/
// solhint-disable-next-line func-name-mixedcase
function DOMAIN_SEPARATOR() external view returns (bytes32);
}
// File: @openzeppelin/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v4.6.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);
}
// File: @openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)
pragma solidity ^0.8.0;
/**
* @title SafeERC20
* @dev Wrappers around ERC20 operations that throw on failure (when the token
* contract returns false). Tokens that return no value (and instead revert or
* throw on failure) are also supported, non-reverting calls are assumed to be
* successful.
* To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using Address for address;
function safeTransfer(
IERC20 token,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
}
function safeTransferFrom(
IERC20 token,
address from,
address to,
uint256 value
) internal {
_callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
}
/**
* @dev Deprecated. This function has issues similar to the ones found in
* {IERC20-approve}, and its usage is discouraged.
*
* Whenever possible, use {safeIncreaseAllowance} and
* {safeDecreaseAllowance} instead.
*/
function safeApprove(
IERC20 token,
address spender,
uint256 value
) internal {
// safeApprove should only be called when setting an initial allowance,
// or when resetting it to zero. To increase and decrease it, use
// 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
require(
(value == 0) || (token.allowance(address(this), spender) == 0),
"SafeERC20: approve from non-zero to non-zero allowance"
);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
}
function safeIncreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
uint256 newAllowance = token.allowance(address(this), spender) + value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(
IERC20 token,
address spender,
uint256 value
) internal {
unchecked {
uint256 oldAllowance = token.allowance(address(this), spender);
require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
uint256 newAllowance = oldAllowance - value;
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
}
function safePermit(
IERC20Permit token,
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) internal {
uint256 nonceBefore = token.nonces(owner);
token.permit(owner, spender, value, deadline, v, r, s);
uint256 nonceAfter = token.nonces(owner);
require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
}
/**
* @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
* on the return value: the return value is optional (but if data is returned, it must not be false).
* @param token The token targeted by the call.
* @param data The call data (encoded using abi.encode or one of its variants).
*/
function _callOptionalReturn(IERC20 token, bytes memory data) private {
// We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
// we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
// the target address contains contract code and also asserts for success in the low-level call.
bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
if (returndata.length > 0) {
// Return data is optional
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File: @openzeppelin/contracts/utils/Context.sol
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
// File: @openzeppelin/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (access/Ownable.sol)
pragma solidity ^0.8.0;
/**
* @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 anymore. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby removing 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);
}
}
// File: @openzeppelin/contracts/security/Pausable.sol
// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)
pragma solidity ^0.8.0;
/**
* @dev Contract module which allows children to implement an emergency stop
* mechanism that can be triggered by an authorized account.
*
* This module is used through inheritance. It will make available the
* modifiers `whenNotPaused` and `whenPaused`, which can be applied to
* the functions of your contract. Note that they will not be pausable by
* simply including this module, only once the modifiers are put in place.
*/
abstract contract Pausable is Context {
/**
* @dev Emitted when the pause is triggered by `account`.
*/
event Paused(address account);
/**
* @dev Emitted when the pause is lifted by `account`.
*/
event Unpaused(address account);
bool private _paused;
/**
* @dev Initializes the contract in unpaused state.
*/
constructor() {
_paused = false;
}
/**
* @dev Modifier to make a function callable only when the contract is not paused.
*
* Requirements:
*
* - The contract must not be paused.
*/
modifier whenNotPaused() {
_requireNotPaused();
_;
}
/**
* @dev Modifier to make a function callable only when the contract is paused.
*
* Requirements:
*
* - The contract must be paused.
*/
modifier whenPaused() {
_requirePaused();
_;
}
/**
* @dev Returns true if the contract is paused, and false otherwise.
*/
function paused() public view virtual returns (bool) {
return _paused;
}
/**
* @dev Throws if the contract is paused.
*/
function _requireNotPaused() internal view virtual {
require(!paused(), "Pausable: paused");
}
/**
* @dev Throws if the contract is not paused.
*/
function _requirePaused() internal view virtual {
require(paused(), "Pausable: not paused");
}
/**
* @dev Triggers stopped state.
*
* Requirements:
*
* - The contract must not be paused.
*/
function _pause() internal virtual whenNotPaused {
_paused = true;
emit Paused(_msgSender());
}
/**
* @dev Returns to normal state.
*
* Requirements:
*
* - The contract must be paused.
*/
function _unpause() internal virtual whenPaused {
_paused = false;
emit Unpaused(_msgSender());
}
}
// File: contracts/LiquidusAutoLP.sol
pragma solidity 0.8.4;
interface IWETH {
function name() external view returns (string memory);
function symbol() external view returns (string memory);
function decimals() external view returns (uint8);
function balanceOf(address) external view returns (uint);
function allowance(address, address) external view returns (uint);
receive() external payable;
function deposit() external payable;
function withdraw(uint wad) external;
function totalSupply() external view returns (uint);
function approve(address guy, uint wad) external returns (bool);
function transfer(address dst, uint wad) external returns (bool);
function transferFrom(address src, address dst, uint wad)
external
returns (bool);
}
interface IUniswapV2Router01 {
function factory() external pure returns (address);
function WETH() external pure returns (address);
function addLiquidity(
address tokenA,
address tokenB,
uint amountADesired,
uint amountBDesired,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB, uint liquidity);
function addLiquidityETH(
address token,
uint amountTokenDesired,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external payable returns (uint amountToken, uint amountETH, uint liquidity);
function removeLiquidity(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline
) external returns (uint amountA, uint amountB);
function removeLiquidityETH(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountToken, uint amountETH);
function removeLiquidityWithPermit(
address tokenA,
address tokenB,
uint liquidity,
uint amountAMin,
uint amountBMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountA, uint amountB);
function removeLiquidityETHWithPermit(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountToken, uint amountETH);
function swapExactTokensForTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapTokensForExactTokens(
uint amountOut,
uint amountInMax,
address[] calldata path,
address to,
uint deadline
) external returns (uint[] memory amounts);
function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
external
returns (uint[] memory amounts);
function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
external
payable
returns (uint[] memory amounts);
function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}
interface IUniswapV2Router02 is IUniswapV2Router01 {
function removeLiquidityETHSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline
) external returns (uint amountETH);
function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
address token,
uint liquidity,
uint amountTokenMin,
uint amountETHMin,
address to,
uint deadline,
bool approveMax, uint8 v, bytes32 r, bytes32 s
) external returns (uint amountETH);
function swapExactTokensForTokensSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
function swapExactETHForTokensSupportingFeeOnTransferTokens(
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external payable;
function swapExactTokensForETHSupportingFeeOnTransferTokens(
uint amountIn,
uint amountOutMin,
address[] calldata path,
address to,
uint deadline
) external;
}
interface IUniswapV2Factory {
event PairCreated(address indexed token0, address indexed token1, address pair, uint);
function feeTo() external view returns (address);
function feeToSetter() external view returns (address);
function getPair(address tokenA, address tokenB) external view returns (address pair);
function allPairs(uint) external view returns (address pair);
function allPairsLength() external view returns (uint);
function createPair(address tokenA, address tokenB) external returns (address pair);
function setFeeTo(address) external;
function setFeeToSetter(address) external;
}
interface IUniswapV2Pair {
event Approval(address indexed owner, address indexed spender, uint value);
event Transfer(address indexed from, address indexed to, uint value);
function name() external pure returns (string memory);
function symbol() external pure returns (string memory);
function decimals() external pure returns (uint8);
function totalSupply() external view returns (uint);
function balanceOf(address owner) external view returns (uint);
function allowance(address owner, address spender) external view returns (uint);
function approve(address spender, uint value) external returns (bool);
function transfer(address to, uint value) external returns (bool);
function transferFrom(address from, address to, uint value) external returns (bool);
function DOMAIN_SEPARATOR() external view returns (bytes32);
function PERMIT_TYPEHASH() external pure returns (bytes32);
function nonces(address owner) external view returns (uint);
function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;
event Mint(address indexed sender, uint amount0, uint amount1);
event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
event Swap(
address indexed sender,
uint amount0In,
uint amount1In,
uint amount0Out,
uint amount1Out,
address indexed to
);
event Sync(uint112 reserve0, uint112 reserve1);
function MINIMUM_LIQUIDITY() external pure returns (uint);
function factory() external view returns (address);
function token0() external view returns (address);
function token1() external view returns (address);
function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
function price0CumulativeLast() external view returns (uint);
function price1CumulativeLast() external view returns (uint);
function kLast() external view returns (uint);
function mint(address to) external returns (uint liquidity);
function burn(address to) external returns (uint amount0, uint amount1);
function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
function skim(address to) external;
function sync() external;
function initialize(address, address) external;
}
interface ILiquidusFeeEstimation {
function userFee(address user) external view returns (uint256);
}
pragma experimental ABIEncoderV2;
contract LiquidusAutoLPFarmIn is Ownable, ReentrancyGuard, Pausable {
using SafeMath for uint256;
using SafeERC20 for IERC20;
mapping(address => bool) public whitelistRouters;
mapping(address => bool) public whitelistFromFee;
event AdminTokenRecovery(address tokenRecovered, uint256 amount);
address public feeWallet;
address public feeEstimationContract;
address private _ETH_ADDRESS_ = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
struct SwapCall {
address _swapToken; // Token to be swapped
address _router; // Address of router contract for performing the swap
bytes apiData; // Kyberswap api data, recipient in API request should be this contract!
}
struct AddLiquidityCall {
address _router; // Address of router contract for adding liquidity
uint256 _amount0Min; // Minimum amount of toToken0 before transaction reverts (account for fee)
uint256 _amount1Min; // Minimum amount of toToken1 before transaction reverts (account for fee)
}
struct ZapInCall {
address[] _inTokens; // Addresses of input tokens
uint256[] _inAmounts; // Amounts of input tokens to swap/deposit
address[] _toTokens; // Address of second output tokens
SwapCall[] swaps; // Swaps to execute
AddLiquidityCall addLiquidityCall; // Liquidity add call data
address _lpAddress; // Address of the LP token
}
function zapIn(
ZapInCall calldata params
) payable external nonReentrant whenNotPaused returns (uint256 amountOut0, uint256 amountOut1, uint256 liquidity){
require(params._inTokens.length <= 2 && params._inTokens.length >=1, "Max 2 input tokens");
require(params._toTokens.length == 2, "Max and min 2 output tokens");
require(params._toTokens[0] == IUniswapV2Pair(params._lpAddress).token0() && params._toTokens[1] == IUniswapV2Pair(params._lpAddress).token1()
|| params._toTokens[0] == IUniswapV2Pair(params._lpAddress).token1() && params._toTokens[1] == IUniswapV2Pair(params._lpAddress).token0(),
"Error - Mismatch lpAddress and toTokens");
require(whitelistRouters[params.addLiquidityCall._router], "Error - Liquidity router is not whitelisted");
require(params.swaps.length < 6, "Error - too many swaps");
//if one of inputs in _inTokens is ETH -> Swap Eth to WETH, same amount as _inAmount
for(uint i = 0; i < params._inTokens.length; i++){
if(params._inTokens[i] == _ETH_ADDRESS_){
require(msg.value == params._inAmounts[i], "Mismatch ETH amount");
IWETH(payable(IUniswapV2Router02(params.addLiquidityCall._router).WETH()))
.deposit{ value: msg.value }();
} else {
IERC20(params._inTokens[i]).safeTransferFrom(msg.sender, address(this), params._inAmounts[i]);
}
}
//swap tokens
for(uint i = 0; i < params.swaps.length; i++){
require(whitelistRouters[params.swaps[i]._router], "Swap router not whitelisted");
_generalApproveMax(params.swaps[i]._swapToken, params.swaps[i]._router, IERC20(params.swaps[i]._swapToken).balanceOf(address(this)));
(bool success, ) = params.swaps[i]._router.call(params.swaps[i].apiData);
require(success, "Swap failed");
}
// Handle fee, send fee to fee address
if(!whitelistFromFee[msg.sender]){
uint256 fee = ILiquidusFeeEstimation(feeEstimationContract).userFee(msg.sender);
// Charge fees based on holdings
if (fee != 0){
IERC20(params._toTokens[0]).safeTransfer(feeWallet, IERC20(params._toTokens[0]).balanceOf(address(this)).mul(fee).div(10000));
IERC20(params._toTokens[1]).safeTransfer(feeWallet, IERC20(params._toTokens[1]).balanceOf(address(this)).mul(fee).div(10000));
}
}
// Approve to add liquidity
_generalApproveMax(params._toTokens[0], params.addLiquidityCall._router, IERC20(params._toTokens[0]).balanceOf(address(this)));
_generalApproveMax(params._toTokens[1], params.addLiquidityCall._router, IERC20(params._toTokens[1]).balanceOf(address(this)));
// Add liquidity, mint lp token to user
(amountOut0, amountOut1, liquidity) = IUniswapV2Router02(params.addLiquidityCall._router).addLiquidity(
params._toTokens[0],
params._toTokens[1],
IERC20(params._toTokens[0]).balanceOf(address(this)),
IERC20(params._toTokens[1]).balanceOf(address(this)),
params.addLiquidityCall._amount0Min,
params.addLiquidityCall._amount1Min,
msg.sender,
uint256(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
);
// Send residual back to caller
uint256 balance0 = IERC20(params._toTokens[0]).balanceOf(address(this));
uint256 balance1 = IERC20(params._toTokens[1]).balanceOf(address(this));
if (balance0 > 0) {IERC20(params._toTokens[0]).safeTransfer(address(msg.sender), balance0);}
if (balance1 > 0) {IERC20(params._toTokens[1]).safeTransfer(address(msg.sender), balance1);}
}
function _generalApproveMax(
address token,
address to,
uint256 amount
) internal {
uint256 allowance = IERC20(token).allowance(address(this), to);
if (allowance < amount) {
if (allowance > 0) {
IERC20(token).safeApprove(to, 0);
}
IERC20(token).safeApprove(to, uint256(0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff));
}
}
function setFees(address _feeWallet, address _feeEstimationContract) public onlyOwner {
feeWallet = _feeWallet;
feeEstimationContract = _feeEstimationContract;
}
function recoverWrongTokens(address _tokenAddress, uint256 _tokenAmount) external onlyOwner {
IERC20(_tokenAddress).safeTransfer(address(msg.sender), _tokenAmount);
emit AdminTokenRecovery(_tokenAddress, _tokenAmount);
}
function addWhitelistFromFee(address _account) public onlyOwner {
whitelistFromFee[_account] = true;
...
// [truncated — 58376 bytes total]
Read Contract
feeEstimationContract 0x404ea1bd → address
feeWallet 0xf25f4b56 → address
owner 0x8da5cb5b → address
paused 0x5c975abb → bool
wETH 0xf2428621 → address
whitelistFromFee 0x540eee27 → bool
whitelistRouters 0x7aa51fd6 → bool
Write Contract 11 functions
These functions modify contract state and require a wallet transaction to execute.
addWhitelistFromFee 0xfcd4efd0
address _account
addWhitelistRouters 0x9378f2e1
address _router
pause 0x8456cb59
No parameters
recoverWrongTokens 0x3f138d4b
address _tokenAddress
uint256 _tokenAmount
removeWhitelistFromFee 0x4f258ad9
address _account
removeWhitelistRouters 0x7b72a045
address _router
renounceOwnership 0x715018a6
No parameters
setFees 0x8f01f9d1
address _feeWallet
address _feeEstimationContract
transferOwnership 0xf2fde38b
address newOwner
unpause 0x3f4ba83a
No parameters
zapOut 0x68b41846
tuple params
Recent Transactions
No transactions found for this address