Address Contract Partially Verified
Address
0xCc886C93C4D06b0Fb69741D0dcD0f566C926E827
Balance
0 ETH
Nonce
1
Code Size
16313 bytes
Creator
0x606d2C43...9Ee9 at tx 0x579a3fff...b2c16b
Indexed Transactions
0
Contract Bytecode
16313 bytes
0x60806040526004361061019f575f3560e01c80638c4fd486116100eb578063d294f09311610089578063dd62ed3e11610063578063dd62ed3e1461059a578063dff7e3cb146105d6578063e444504c146105fe578063f2fde38b14610628576101a6565b8063d294f09314610532578063d2ab71f514610548578063d5c11e3014610570576101a6565b806395d89b41116100c557806395d89b4114610468578063a9059cbb14610492578063ac4afa38146104ce578063bdd859ce1461050a576101a6565b80638c4fd486146103d85780638da5cb5b14610414578063947a36fb1461043e576101a6565b806332fe7b261161015857806370a082311161013257806370a0823114610346578063715018a6146103825780637824407f146103985780638129fc1c146103c2576101a6565b806332fe7b26146102ca5780633659ffb2146102f45780634e71d92d14610330576101a6565b806306fdde03146101aa578063095ea7b3146101d457806318160ddd1461021057806318f3b92a1461023a57806323b872dd14610264578063313ce567146102a0576101a6565b366101a657005b5f80fd5b3480156101b5575f80fd5b506101be610650565b6040516101cb9190612e96565b60405180910390f35b3480156101df575f80fd5b506101fa60048036038101906101f59190612f54565b6106e0565b6040516102079190612fac565b60405180910390f35b34801561021b575f80fd5b50610224610702565b6040516102319190612fd4565b60405180910390f35b348015610245575f80fd5b5061024e61070b565b60405161025b91906130a4565b60405180910390f35b34801561026f575f80fd5b5061028a600480360381019061028591906130c4565b610761565b6040516102979190612fac565b60405180910390f35b3480156102ab575f80fd5b506102b461078f565b6040516102c1919061312f565b60405180910390f35b3480156102d5575f80fd5b506102de610797565b6040516102eb91906131a3565b60405180910390f35b3480156102ff575f80fd5b5061031a600480360381019061031591906131bc565b6107af565b6040516103279190612fac565b60405180910390f35b34801561033b575f80fd5b506103446107cc565b005b348015610351575f80fd5b5061036c600480360381019061036791906131bc565b610a14565b6040516103799190612fd4565b60405180910390f35b34801561038d575f80fd5b50610396610a59565b005b3480156103a3575f80fd5b506103ac610a6c565b6040516103b99190612fd4565b60405180910390f35b3480156103cd575f80fd5b506103d6610a72565b005b3480156103e3575f80fd5b506103fe60048036038101906103f9919061321f565b610c9f565b60405161040b9190612fac565b60405180910390f35b34801561041f575f80fd5b50610428610cc9565b604051610435919061326c565b60405180910390f35b348015610449575f80fd5b50610452610cf1565b60405161045f9190612fd4565b60405180910390f35b348015610473575f80fd5b5061047c610cf7565b6040516104899190612e96565b60405180910390f35b34801561049d575f80fd5b506104b860048036038101906104b39190612f54565b610d87565b6040516104c59190612fac565b60405180910390f35b3480156104d9575f80fd5b506104f460048036038101906104ef9190613285565b610da9565b604051610501919061326c565b60405180910390f35b348015610515575f80fd5b50610530600480360381019061052b91906133f0565b610de4565b005b34801561053d575f80fd5b50610546610ff9565b005b348015610553575f80fd5b5061056e60048036038101906105699190613437565b611359565b005b34801561057b575f80fd5b506105846117e1565b6040516105919190613552565b60405180910390f35b3480156105a5575f80fd5b506105c060048036038101906105bb9190613572565b61186c565b6040516105cd9190612fd4565b60405180910390f35b3480156105e1575f80fd5b506105fc60048036038101906105f79190613670565b6118ee565b005b348015610609575f80fd5b5061061261192d565b60405161061f9190612fd4565b60405180910390f35b348015610633575f80fd5b5061064e600480360381019061064991906131bc565b611933565b005b60606003805461065f906136e4565b80601f016020809104026020016040519081016040528092919081815260200182805461068b906136e4565b80156106d65780601f106106ad576101008083540402835291602001916106d6565b820191905f5260205f20905b8154815290600101906020018083116106b957829003601f168201915b5050505050905090565b5f806106ea6119b7565b90506106f78185856119be565b600191505092915050565b5f600254905090565b6060600980548060200260200160405190810160405280929190818152602001828054801561075757602002820191905f5260205f20905b815481526020019060010190808311610743575b5050505050905090565b5f8061076b6119b7565b90506107788582856119d0565b610783858585611a62565b60019150509392505050565b5f6012905090565b7368b3465833fb72a70ecdf485e0e4c7bd8665fc4581565b600e602052805f5260405f205f915054906101000a900460ff1681565b6107d4611b52565b6107dc611bd9565b600b54426107ea9190613741565b600c819055505f5b6008805490508110156109bf575f6008828154811061081457610813613774565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610878919061326c565b602060405180830381865afa158015610893573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906108b791906137b5565b11156109b1578073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338373ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b8152600401610913919061326c565b602060405180830381865afa15801561092e573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061095291906137b5565b6040518363ffffffff1660e01b815260040161096f9291906137e0565b6020604051808303815f875af115801561098b573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906109af9190613831565b505b8180600101925050506107f2565b505f4790505f811115610a11575f6109d5610cc9565b90505f8173ffffffffffffffffffffffffffffffffffffffff166108fc8490811502906040515f60405180830381858888f19350505050905050505b50565b5f805f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050919050565b610a61611b52565b610a6a5f611c1d565b565b600d5481565b5f610a7b610702565b14610a84575f80fd5b610a9030600d54611ce0565b5f600880549050600d54610aa49190613889565b90505f5b600880549050811015610c9b5781610abe610702565b10610c8e57610b5760068281548110610ada57610ad9613774565b5b905f5260205f20015460078381548110610af757610af6613774565b5b905f5260205f200154600880549050600d54610b139190613889565b60088581548110610b2757610b26613774565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16612710611d5f565b6001600f5f60088481548110610b7057610b6f613774565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f61271062ffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055506001600e5f60088481548110610c1657610c15613774565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505b8080600101915050610aa8565b5050565b600f602052815f5260405f20602052805f5260405f205f915091509054906101000a900460ff1681565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905090565b600b5481565b606060048054610d06906136e4565b80601f0160208091040260200160405190810160405280929190818152602001828054610d32906136e4565b8015610d7d5780601f10610d5457610100808354040283529160200191610d7d565b820191905f5260205f20905b815481529060010190602001808311610d6057829003601f168201915b5050505050905090565b5f80610d916119b7565b9050610d9e818585611a62565b600191505092915050565b600a8181548110610db8575f80fd5b905f5260205f20015f915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b610dec611b52565b5f3090505f5b8251811015610fa2578173ffffffffffffffffffffffffffffffffffffffff16838281518110610e2557610e24613774565b5b602002602001015173ffffffffffffffffffffffffffffffffffffffff1603610e83576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610e7a90613903565b60405180910390fd5b5f838281518110610e9757610e96613774565b5b602002602001015190508073ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338373ffffffffffffffffffffffffffffffffffffffff166370a08231876040518263ffffffff1660e01b8152600401610ef7919061326c565b602060405180830381865afa158015610f12573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f3691906137b5565b6040518363ffffffff1660e01b8152600401610f539291906137e0565b6020604051808303815f875af1158015610f6f573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190610f939190613831565b50818060010192505050610df2565b505f4790505f811115610ff4575f610fb8610cc9565b90505f8173ffffffffffffffffffffffffffffffffffffffff166108fc8490811502906040515f60405180830381858888f19350505050905050505b505050565b42600c541061103d576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016110349061396b565b60405180910390fd5b600b544261104b9190613741565b600c81905550611059611bd9565b5f5b6008805490508110156112bc575f6008828154811061107d5761107c613774565b5b905f5260205f20015f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690505f8173ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b81526004016110e1919061326c565b602060405180830381865afa1580156110fc573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061112091906137b5565b90505f8111156112ad578173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb336032846111549190613889565b6040518363ffffffff1660e01b81526004016111719291906137e0565b6020604051808303815f875af115801561118d573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906111b19190613831565b508173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb6111d6610cc9565b8473ffffffffffffffffffffffffffffffffffffffff166370a08231306040518263ffffffff1660e01b815260040161120f919061326c565b602060405180830381865afa15801561122a573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061124e91906137b5565b6040518363ffffffff1660e01b815260040161126b9291906137e0565b6020604051808303815f875af1158015611287573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906112ab9190613831565b505b8280600101935050505061105b565b505f4790506032811115611356575f3390505f8173ffffffffffffffffffffffffffffffffffffffff166108fc6032856112f69190613889565b90811502906040515f60405180830381858888f1935050505090505f61131a610cc9565b90508073ffffffffffffffffffffffffffffffffffffffff166108fc4790811502906040515f60405180830381858888f1935050505091505050505b50565b611361611b52565b8282116113a3576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161139a906139d3565b60405180910390fd5b600f5f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8262ffffff1662ffffff1681526020019081526020015f205f9054906101000a900460ff1615611446576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161143d90613a3b565b60405180910390fd5b6001600f5f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8362ffffff1662ffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505f3090505f6114f48273ffffffffffffffffffffffffffffffffffffffff168773ffffffffffffffffffffffffffffffffffffffff1610600d5487611e41565b5090505f7368b3465833fb72a70ecdf485e0e4c7bd8665fc4573ffffffffffffffffffffffffffffffffffffffff1663c45a01556040518163ffffffff1660e01b8152600401602060405180830381865afa158015611555573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115799190613a6d565b73ffffffffffffffffffffffffffffffffffffffff1663a167129584896127106040518463ffffffff1660e01b81526004016115b793929190613ad1565b6020604051808303815f875af11580156115d3573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906115f79190613a6d565b90508073ffffffffffffffffffffffffffffffffffffffff1663f637731d836040518263ffffffff1660e01b81526004016116329190613b15565b5f604051808303815f87803b158015611649575f80fd5b505af115801561165b573d5f803e3d5ffd5b50505050600a81908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506116d486866116cd86610a14565b8a88611d5f565b600e5f8873ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f9054906101000a900460ff166117d857600887908060018154018082558091505060019003905f5260205f20015f9091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600e5f8973ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f6101000a81548160ff0219169083151502179055505b50505050505050565b6060600880548060200260200160405190810160405280929190818152602001828054801561186257602002820191905f5260205f20905b815f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019060010190808311611819575b5050505050905090565b5f60015f8473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2054905092915050565b5f5b81518110156119295761191c82828151811061190f5761190e613774565b5b6020026020010151611ed0565b80806001019150506118f0565b5050565b600c5481565b61193b611b52565b5f73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16036119ab575f6040517f1e4fbdf70000000000000000000000000000000000000000000000000000000081526004016119a2919061326c565b60405180910390fd5b6119b481611c1d565b50565b5f33905090565b6119cb8383836001612041565b505050565b5f6119db848461186c565b90507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8114611a5c5781811015611a4d578281836040517ffb8f41b2000000000000000000000000000000000000000000000000000000008152600401611a4493929190613b2e565b60405180910390fd5b611a5b84848484035f612041565b5b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603611ad2575f6040517f96c6fd1e000000000000000000000000000000000000000000000000000000008152600401611ac9919061326c565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611b42575f6040517fec442f05000000000000000000000000000000000000000000000000000000008152600401611b39919061326c565b60405180910390fd5b611b4d838383612210565b505050565b611b5a6119b7565b73ffffffffffffffffffffffffffffffffffffffff16611b78610cc9565b73ffffffffffffffffffffffffffffffffffffffff1614611bd757611b9b6119b7565b6040517f118cdaa7000000000000000000000000000000000000000000000000000000008152600401611bce919061326c565b60405180910390fd5b565b5f5b600980549050811015611c1a57611c0d60098281548110611bff57611bfe613774565b5b905f5260205f200154611ed0565b8080600101915050611bdb565b50565b5f60055f9054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508160055f6101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055508173ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff167f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e060405160405180910390a35050565b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603611d50575f6040517fec442f05000000000000000000000000000000000000000000000000000000008152600401611d47919061326c565b60405180910390fd5b611d5b5f8383612210565b5050565b5f3090505f8173ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16109050600b5442611da39190613741565b600c819055505f611db782600d548a611e41565b9150505f611dc883600d548a611e41565b9150506009611e1387868687611dde5786611de0565b855b8815611dec5787611dee565b865b611df78b610a14565b8e11611e03578d611e0d565b611e0c8b610a14565b5b8c612429565b908060018154018082558091505060019003905f5260205f20015f9091909190915055505050505050505050565b5f805f611e9586611e525784611e54565b855b8715611e605785611e62565b865b7801000000000000000000000000000000000000000000000000611e869190613889565b611e909190613b63565b612612565b9050611ea08161266b565b915060c882611eaf9190613bb0565b82611eba9190613be0565b9150611ec582612a2c565b925050935093915050565b5f7368b3465833fb72a70ecdf485e0e4c7bd8665fc4573ffffffffffffffffffffffffffffffffffffffff1663791b98bc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f2e573d5f803e3d5ffd5b505050506040513d601f19601f82011682018060405250810190611f529190613a6d565b90505f6fffffffffffffffffffffffffffffffff90508173ffffffffffffffffffffffffffffffffffffffff1663fc6f786560405180608001604052808681526020013073ffffffffffffffffffffffffffffffffffffffff168152602001846fffffffffffffffffffffffffffffffff168152602001846fffffffffffffffffffffffffffffffff168152506040518263ffffffff1660e01b8152600401611ffb9190613cb7565b60408051808303815f875af1158015612016573d5f803e3d5ffd5b505050506040513d601f19601f8201168201806040525081019061203a9190613cd0565b5050505050565b5f73ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff16036120b1575f6040517fe602df050000000000000000000000000000000000000000000000000000000081526004016120a8919061326c565b60405180910390fd5b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612121575f6040517f94280d62000000000000000000000000000000000000000000000000000000008152600401612118919061326c565b60405180910390fd5b8160015f8673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550801561220a578273ffffffffffffffffffffffffffffffffffffffff168473ffffffffffffffffffffffffffffffffffffffff167f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b925846040516122019190612fd4565b60405180910390a35b50505050565b5f73ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff1603612260578060025f8282546122549190613741565b9250508190555061232e565b5f805f8573ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f20549050818110156122e9578381836040517fe450d38c0000000000000000000000000000000000000000000000000000000081526004016122e093929190613b2e565b60405180910390fd5b8181035f808673ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f2081905550505b5f73ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1603612375578060025f82825403925050819055506123bf565b805f808473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1681526020019081526020015f205f82825401925050819055505b8173ffffffffffffffffffffffffffffffffffffffff168373ffffffffffffffffffffffffffffffffffffffff167fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef8360405161241c9190612fd4565b60405180910390a3505050565b5f807368b3465833fb72a70ecdf485e0e4c7bd8665fc4573ffffffffffffffffffffffffffffffffffffffff1663791b98bc6040518163ffffffff1660e01b8152600401602060405180830381865afa158015612488573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906124ac9190613a6d565b90506124b98882866119be565b8073ffffffffffffffffffffffffffffffffffffffff1663883164566040518061016001604052808a6124ec578b6124ee565b8c5b73ffffffffffffffffffffffffffffffffffffffff1681526020018a15612515578b612517565b8c5b73ffffffffffffffffffffffffffffffffffffffff1681526020018662ffffff1681526020018960020b81526020018860020b81526020018a61255a578761255c565b5f5b81526020018a1561256d578761256f565b5f5b81526020015f81526020015f81526020018b73ffffffffffffffffffffffffffffffffffffffff168152602001428152506040518263ffffffff1660e01b81526004016125bc9190613e0b565b6080604051808303815f875af11580156125d8573d5f803e3d5ffd5b505050506040513d601f19601f820116820180604052508101906125fc9190613e4f565b9091509050508092505050979650505050505050565b5f80600260018401816126285761262761385c565b5b0490508291505b818110156126655780915060028182858161264d5761264c61385c565b5b04018161265d5761265c61385c565b5b04905061262f565b50919050565b5f6401000276a373ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16101580156126ec575073fffd8963efd1fc6a506488495d951d5263988d2673ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16105b61272b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161272290613efd565b60405180910390fd5b5f60208373ffffffffffffffffffffffffffffffffffffffff16901b90505f8190505f6fffffffffffffffffffffffffffffffff821160071b808217915082811c92505067ffffffffffffffff821160061b808217915082811c92505063ffffffff821160051b808217915082811c92505061ffff821160041b808217915082811c92505060ff821160031b808217915082811c925050600f821160021b808217915082811c9250506003821160011b808217915082811c925050600182118082179150506080811061280657607f810383901c9150612810565b80607f0383901b91505b5f604060808303901b9050828302607f1c92508260801c80603f1b8217915083811c935050828302607f1c92508260801c80603e1b8217915083811c935050828302607f1c92508260801c80603d1b8217915083811c935050828302607f1c92508260801c80603c1b8217915083811c935050828302607f1c92508260801c80603b1b8217915083811c935050828302607f1c92508260801c80603a1b8217915083811c935050828302607f1c92508260801c8060391b8217915083811c935050828302607f1c92508260801c8060381b8217915083811c935050828302607f1c92508260801c8060371b8217915083811c935050828302607f1c92508260801c8060361b8217915083811c935050828302607f1c92508260801c8060351b8217915083811c935050828302607f1c92508260801c8060341b8217915083811c935050828302607f1c92508260801c8060331b8217915083811c935050828302607f1c92508260801c8060321b82179150505f693627a301d71055774c85820290505f60806f028f6481ab7f045a5af012a19d003aaa8303901d90505f60806fdb2df09e81959a81455e260799a0632f8401901d90508060020b8260020b14612a1c578873ffffffffffffffffffffffffffffffffffffffff166129f382612a2c565b73ffffffffffffffffffffffffffffffffffffffff161115612a155781612a17565b805b612a1e565b815b975050505050505050919050565b5f805f8360020b12612a41578260020b612a48565b8260020b5f035b90507ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff276185f0360020b811115612ab2576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612aa990613f65565b60405180910390fd5b5f806001831603612ad457700100000000000000000000000000000000612ae6565b6ffffcb933bd6fad37aa2d162d1a5940015b70ffffffffffffffffffffffffffffffffff1690505f6002831614612b1f5760806ffff97272373d413259a46990580e213a8202901c90505b5f6004831614612b435760806ffff2e50f5f656932ef12357cf3c7fdcc8202901c90505b5f6008831614612b675760806fffe5caca7e10e4e61c3624eaa0941cd08202901c90505b5f6010831614612b8b5760806fffcb9843d60f6159c9db58835c9266448202901c90505b5f6020831614612baf5760806fff973b41fa98c081472e6896dfb254c08202901c90505b5f6040831614612bd35760806fff2ea16466c96a3843ec78b326b528618202901c90505b5f6080831614612bf75760806ffe5dee046a99a2a811c461f1969c30538202901c90505b5f610100831614612c1c5760806ffcbe86c7900a88aedcffc83b479aa3a48202901c90505b5f610200831614612c415760806ff987a7253ac413176f2b074cf7815e548202901c90505b5f610400831614612c665760806ff3392b0822b70005940c7a398e4b70f38202901c90505b5f610800831614612c8b5760806fe7159475a2c29b7443b29c7fa6e889d98202901c90505b5f611000831614612cb05760806fd097f3bdfd2022b8845ad8f792aa58258202901c90505b5f612000831614612cd55760806fa9f746462d870fdf8a65dc1f90e061e58202901c90505b5f614000831614612cfa5760806f70d869a156d2a1b890bb3df62baf32f78202901c90505b5f618000831614612d1f5760806f31be135f97d08fd981231505542fcfa68202901c90505b5f62010000831614612d455760806f09aa508b5b7a84e1c677de54f3e99bc98202901c90505b5f62020000831614612d6a5760806e5d6af8dedb81196699c329225ee6048202901c90505b5f62040000831614612d8e5760806d2216e584f5fa1ea926041bedfe988202901c90505b5f62080000831614612db05760806b048a170391f7dc42444e8fa28202901c90505b5f8460020b1315612def57807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81612deb57612dea61385c565b5b0490505b5f6401000000008281612e0557612e0461385c565b5b0614612e12576001612e14565b5f5b60ff16602082901c0192505050919050565b5f81519050919050565b5f82825260208201905092915050565b8281835e5f83830152505050565b5f601f19601f8301169050919050565b5f612e6882612e26565b612e728185612e30565b9350612e82818560208601612e40565b612e8b81612e4e565b840191505092915050565b5f6020820190508181035f830152612eae8184612e5e565b905092915050565b5f604051905090565b5f80fd5b5f80fd5b5f73ffffffffffffffffffffffffffffffffffffffff82169050919050565b5f612ef082612ec7565b9050919050565b612f0081612ee6565b8114612f0a575f80fd5b50565b5f81359050612f1b81612ef7565b92915050565b5f819050919050565b612f3381612f21565b8114612f3d575f80fd5b50565b5f81359050612f4e81612f2a565b92915050565b5f8060408385031215612f6a57612f69612ebf565b5b5f612f7785828601612f0d565b9250506020612f8885828601612f40565b9150509250929050565b5f8115159050919050565b612fa681612f92565b82525050565b5f602082019050612fbf5f830184612f9d565b92915050565b612fce81612f21565b82525050565b5f602082019050612fe75f830184612fc5565b92915050565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b61301f81612f21565b82525050565b5f6130308383613016565b60208301905092915050565b5f602082019050919050565b5f61305282612fed565b61305c8185612ff7565b935061306783613007565b805f5b8381101561309757815161307e8882613025565b97506130898361303c565b92505060018101905061306a565b5085935050505092915050565b5f6020820190508181035f8301526130bc8184613048565b905092915050565b5f805f606084860312156130db576130da612ebf565b5b5f6130e886828701612f0d565b93505060206130f986828701612f0d565b925050604061310a86828701612f40565b9150509250925092565b5f60ff82169050919050565b61312981613114565b82525050565b5f6020820190506131425f830184613120565b92915050565b5f819050919050565b5f61316b61316661316184612ec7565b613148565b612ec7565b9050919050565b5f61317c82613151565b9050919050565b5f61318d82613172565b9050919050565b61319d81613183565b82525050565b5f6020820190506131b65f830184613194565b92915050565b5f602082840312156131d1576131d0612ebf565b5b5f6131de84828501612f0d565b91505092915050565b5f62ffffff82169050919050565b6131fe816131e7565b8114613208575f80fd5b50565b5f81359050613219816131f5565b92915050565b5f806040838503121561323557613234612ebf565b5b5f61324285828601612f0d565b92505060206132538582860161320b565b9150509250929050565b61326681612ee6565b82525050565b5f60208201905061327f5f83018461325d565b92915050565b5f6020828403121561329a57613299612ebf565b5b5f6132a784828501612f40565b91505092915050565b5f80fd5b7f4e487b71000000000000000000000000000000000000000000000000000000005f52604160045260245ffd5b6132ea82612e4e565b810181811067ffffffffffffffff82111715613309576133086132b4565b5b80604052505050565b5f61331b612eb6565b905061332782826132e1565b919050565b5f67ffffffffffffffff821115613346576133456132b4565b5b602082029050602081019050919050565b5f80fd5b5f61336d6133688461332c565b613312565b905080838252602082019050602084028301858111156133905761338f613357565b5b835b818110156133b957806133a58882612f0d565b845260208401935050602081019050613392565b5050509392505050565b5f82601f8301126133d7576133d66132b0565b5b81356133e784826020860161335b565b91505092915050565b5f6020828403121561340557613404612ebf565b5b5f82013567ffffffffffffffff81111561342257613421612ec3565b5b61342e848285016133c3565b91505092915050565b5f805f806080858703121561344f5761344e612ebf565b5b5f61345c87828801612f0d565b945050602061346d87828801612f40565b935050604061347e87828801612f40565b925050606061348f8782880161320b565b91505092959194509250565b5f81519050919050565b5f82825260208201905092915050565b5f819050602082019050919050565b6134cd81612ee6565b82525050565b5f6134de83836134c4565b60208301905092915050565b5f602082019050919050565b5f6135008261349b565b61350a81856134a5565b9350613515836134b5565b805f5b8381101561354557815161352c88826134d3565b9750613537836134ea565b925050600181019050613518565b5085935050505092915050565b5f6020820190508181035f83015261356a81846134f6565b905092915050565b5f806040838503121561358857613587612ebf565b5b5f61359585828601612f0d565b92505060206135a685828601612f0d565b9150509250929050565b5f67ffffffffffffffff8211156135ca576135c96132b4565b5b602082029050602081019050919050565b5f6135ed6135e8846135b0565b613312565b905080838252602082019050602084028301858111156136105761360f613357565b5b835b8181101561363957806136258882612f40565b845260208401935050602081019050613612565b5050509392505050565b5f82601f830112613657576136566132b0565b5b81356136678482602086016135db565b91505092915050565b5f6020828403121561368557613684612ebf565b5b5f82013567ffffffffffffffff8111156136a2576136a1612ec3565b5b6136ae84828501613643565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52602260045260245ffd5b5f60028204905060018216806136fb57607f821691505b60208210810361370e5761370d6136b7565b5b50919050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601160045260245ffd5b5f61374b82612f21565b915061375683612f21565b925082820190508082111561376e5761376d613714565b5b92915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52603260045260245ffd5b5f815190506137af81612f2a565b92915050565b5f602082840312156137ca576137c9612ebf565b5b5f6137d7848285016137a1565b91505092915050565b5f6040820190506137f35f83018561325d565b6138006020830184612fc5565b9392505050565b61381081612f92565b811461381a575f80fd5b50565b5f8151905061382b81613807565b92915050565b5f6020828403121561384657613845612ebf565b5b5f6138538482850161381d565b91505092915050565b7f4e487b71000000000000000000000000000000000000000000000000000000005f52601260045260245ffd5b5f61389382612f21565b915061389e83612f21565b9250826138ae576138ad61385c565b5b828204905092915050565b7f43616e6e6f7420776974686472617720636f6e747261637420746f6b656e00005f82015250565b5f6138ed601e83612e30565b91506138f8826138b9565b602082019050919050565b5f6020820190508181035f83015261391a816138e1565b9050919050565b7f4e6f7420656e6f7567682074696d6520686173207061737365640000000000005f82015250565b5f613955601a83612e30565b915061396082613921565b602082019050919050565b5f6020820190508181035f83015261398281613949565b9050919050565b7f466978204d4300000000000000000000000000000000000000000000000000005f82015250565b5f6139bd600683612e30565b91506139c882613989565b602082019050919050565b5f6020820190508181035f8301526139ea816139b1565b9050919050565b7f546f6b656e20416c7265616479205573656400000000000000000000000000005f82015250565b5f613a25601283612e30565b9150613a30826139f1565b602082019050919050565b5f6020820190508181035f830152613a5281613a19565b9050919050565b5f81519050613a6781612ef7565b92915050565b5f60208284031215613a8257613a81612ebf565b5b5f613a8f84828501613a59565b91505092915050565b5f819050919050565b5f613abb613ab6613ab184613a98565b613148565b6131e7565b9050919050565b613acb81613aa1565b82525050565b5f606082019050613ae45f83018661325d565b613af1602083018561325d565b613afe6040830184613ac2565b949350505050565b613b0f81612ec7565b82525050565b5f602082019050613b285f830184613b06565b92915050565b5f606082019050613b415f83018661325d565b613b4e6020830185612fc5565b613b5b6040830184612fc5565b949350505050565b5f613b6d82612f21565b9150613b7883612f21565b9250828202613b8681612f21565b91508282048414831517613b9d57613b9c613714565b5b5092915050565b5f8160020b9050919050565b5f613bba82613ba4565b9150613bc583613ba4565b925082613bd557613bd461385c565b5b828207905092915050565b5f613bea82613ba4565b9150613bf583613ba4565b92508282039050627fffff81137fffffffffffffffffffffffffffffffffffffffffffffffffffffffffff80000082121715613c3457613c33613714565b5b92915050565b5f6fffffffffffffffffffffffffffffffff82169050919050565b613c5e81613c3a565b82525050565b608082015f820151613c785f850182613016565b506020820151613c8b60208501826134c4565b506040820151613c9e6040850182613c55565b506060820151613cb16060850182613c55565b50505050565b5f608082019050613cca5f830184613c64565b92915050565b5f8060408385031215613ce657613ce5612ebf565b5b5f613cf3858286016137a1565b9250506020613d04858286016137a1565b9150509250929050565b613d17816131e7565b82525050565b613d2681613ba4565b82525050565b61016082015f820151613d415f8501826134c4565b506020820151613d5460208501826134c4565b506040820151613d676040850182613d0e565b506060820151613d7a6060850182613d1d565b506080820151613d8d6080850182613d1d565b5060a0820151613da060a0850182613016565b5060c0820151613db360c0850182613016565b5060e0820151613dc660e0850182613016565b50610100820151613ddb610100850182613016565b50610120820151613df06101208501826134c4565b50610140820151613e05610140850182613016565b50505050565b5f61016082019050613e1f5f830184613d2c565b92915050565b613e2e81613c3a565b8114613e38575f80fd5b50565b5f81519050613e4981613e25565b92915050565b5f805f8060808587031215613e6757613e66612ebf565b5b5f613e74878288016137a1565b9450506020613e8587828801613e3b565b9350506040613e96878288016137a1565b9250506060613ea7878288016137a1565b91505092959194509250565b7f52000000000000000000000000000000000000000000000000000000000000005f82015250565b5f613ee7600183612e30565b9150613ef282613eb3565b602082019050919050565b5f6020820190508181035f830152613f1481613edb565b9050919050565b7f54000000000000000000000000000000000000000000000000000000000000005f82015250565b5f613f4f600183612e30565b9150613f5a82613f1b565b602082019050919050565b5f6020820190508181035f830152613f7c81613f43565b905091905056fea26469706673582212206bc098e05a5c825559b5269626c678d1f242b539b4582e7e96ea3a38fc7fb00764736f6c634300081a0033
Verified Source Code Partial Match
Compiler: v0.8.26+commit.8a97fa7a
EVM: cancun
Optimization: No
mainnet_cubex.sol 1423 lines
// File: openzeppelin-contracts/contracts/token/ERC20/IERC20.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface of the ERC-20 standard as defined in the ERC.
*/
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 value of tokens in existence.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns the value of tokens owned by `account`.
*/
function balanceOf(address account) external view returns (uint256);
/**
* @dev Moves a `value` amount of 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 value) 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 a `value` amount of tokens 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 value) external returns (bool);
/**
* @dev Moves a `value` amount of tokens from `from` to `to` using the
* allowance mechanism. `value` 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 value
) external returns (bool);
}
// File: openzeppelin-contracts/contracts/token/ERC20/extensions/IERC20Metadata.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/extensions/IERC20Metadata.sol)
pragma solidity ^0.8.20;
/**
* @dev Interface for the optional metadata functions from the ERC-20 standard.
*/
interface IERC20Metadata is IERC20 {
/**
* @dev Returns the name of the token.
*/
function name() external view returns (string memory);
/**
* @dev Returns the symbol of the token.
*/
function symbol() external view returns (string memory);
/**
* @dev Returns the decimals places of the token.
*/
function decimals() external view returns (uint8);
}
// File: openzeppelin-contracts/contracts/utils/Context.sol
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)
pragma solidity ^0.8.20;
/**
* @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;
}
}
// File: openzeppelin-contracts/contracts/interfaces/draft-IERC6093.sol
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;
/**
* @dev Standard ERC-20 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-20 tokens.
*/
interface IERC20Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientBalance(
address sender,
uint256 balance,
uint256 needed
);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC20InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC20InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
* @param spender Address that may be allowed to operate on tokens without being their owner.
* @param allowance Amount of tokens a `spender` is allowed to operate with.
* @param needed Minimum amount required to perform a transfer.
*/
error ERC20InsufficientAllowance(
address spender,
uint256 allowance,
uint256 needed
);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC20InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `spender` to be approved. Used in approvals.
* @param spender Address that may be allowed to operate on tokens without being their owner.
*/
error ERC20InvalidSpender(address spender);
}
/**
* @dev Standard ERC-721 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-721 tokens.
*/
interface IERC721Errors {
/**
* @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in ERC-20.
* Used in balance queries.
* @param owner Address of the current owner of a token.
*/
error ERC721InvalidOwner(address owner);
/**
* @dev Indicates a `tokenId` whose `owner` is the zero address.
* @param tokenId Identifier number of a token.
*/
error ERC721NonexistentToken(uint256 tokenId);
/**
* @dev Indicates an error related to the ownership over a particular token. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param tokenId Identifier number of a token.
* @param owner Address of the current owner of a token.
*/
error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC721InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC721InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param tokenId Identifier number of a token.
*/
error ERC721InsufficientApproval(address operator, uint256 tokenId);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC721InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC721InvalidOperator(address operator);
}
/**
* @dev Standard ERC-1155 Errors
* Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC-1155 tokens.
*/
interface IERC1155Errors {
/**
* @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
* @param balance Current balance for the interacting account.
* @param needed Minimum amount required to perform a transfer.
* @param tokenId Identifier number of a token.
*/
error ERC1155InsufficientBalance(
address sender,
uint256 balance,
uint256 needed,
uint256 tokenId
);
/**
* @dev Indicates a failure with the token `sender`. Used in transfers.
* @param sender Address whose tokens are being transferred.
*/
error ERC1155InvalidSender(address sender);
/**
* @dev Indicates a failure with the token `receiver`. Used in transfers.
* @param receiver Address to which tokens are being transferred.
*/
error ERC1155InvalidReceiver(address receiver);
/**
* @dev Indicates a failure with the `operator`’s approval. Used in transfers.
* @param operator Address that may be allowed to operate on tokens without being their owner.
* @param owner Address of the current owner of a token.
*/
error ERC1155MissingApprovalForAll(address operator, address owner);
/**
* @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
* @param approver Address initiating an approval operation.
*/
error ERC1155InvalidApprover(address approver);
/**
* @dev Indicates a failure with the `operator` to be approved. Used in approvals.
* @param operator Address that may be allowed to operate on tokens without being their owner.
*/
error ERC1155InvalidOperator(address operator);
/**
* @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
* Used in batch transfers.
* @param idsLength Length of the array of token identifiers
* @param valuesLength Length of the array of token amounts
*/
error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}
// File: openzeppelin-contracts/contracts/token/ERC20/ERC20.sol
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/ERC20.sol)
pragma solidity ^0.8.20;
/**
* @dev Implementation of the {IERC20} interface.
*
* This implementation is agnostic to the way tokens are created. This means
* that a supply mechanism has to be added in a derived contract using {_mint}.
*
* TIP: For a detailed writeup see our guide
* https://forum.openzeppelin.com/t/how-to-implement-erc20-supply-mechanisms/226[How
* to implement supply mechanisms].
*
* The default value of {decimals} is 18. To change this, you should override
* this function so it returns a different value.
*
* We have followed general OpenZeppelin Contracts guidelines: functions revert
* instead returning `false` on failure. This behavior is nonetheless
* conventional and does not conflict with the expectations of ERC-20
* applications.
*/
abstract contract ERC20 is Context, IERC20, IERC20Metadata, IERC20Errors {
mapping(address => uint256) private _balances;
mapping(address => mapping(address => uint256)) private _allowances;
uint256 private _totalSupply;
string private _name;
string private _symbol;
/**
* @dev Sets the values for {name} and {symbol}.
*
* All two of these values are immutable: they can only be set once during
* construction.
*/
constructor(string memory name_, string memory symbol_) {
_name = name_;
_symbol = symbol_;
}
/**
* @dev Returns the name of the token.
*/
function name() public view virtual returns (string memory) {
return _name;
}
/**
* @dev Returns the symbol of the token, usually a shorter version of the
* name.
*/
function symbol() public view virtual returns (string memory) {
return _symbol;
}
/**
* @dev Returns the number of decimals used to get its user representation.
* For example, if `decimals` equals `2`, a balance of `505` tokens should
* be displayed to a user as `5.05` (`505 / 10 ** 2`).
*
* Tokens usually opt for a value of 18, imitating the relationship between
* Ether and Wei. This is the default value returned by this function, unless
* it's overridden.
*
* NOTE: This information is only used for _display_ purposes: it in
* no way affects any of the arithmetic of the contract, including
* {IERC20-balanceOf} and {IERC20-transfer}.
*/
function decimals() public view virtual returns (uint8) {
return 18;
}
/**
* @dev See {IERC20-totalSupply}.
*/
function totalSupply() public view virtual returns (uint256) {
return _totalSupply;
}
/**
* @dev See {IERC20-balanceOf}.
*/
function balanceOf(address account) public view virtual returns (uint256) {
return _balances[account];
}
/**
* @dev See {IERC20-transfer}.
*
* Requirements:
*
* - `to` cannot be the zero address.
* - the caller must have a balance of at least `value`.
*/
function transfer(address to, uint256 value) public virtual returns (bool) {
address owner = _msgSender();
_transfer(owner, to, value);
return true;
}
/**
* @dev See {IERC20-allowance}.
*/
function allowance(address owner, address spender)
public
view
virtual
returns (uint256)
{
return _allowances[owner][spender];
}
/**
* @dev See {IERC20-approve}.
*
* NOTE: If `value` is the maximum `uint256`, the allowance is not updated on
* `transferFrom`. This is semantically equivalent to an infinite approval.
*
* Requirements:
*
* - `spender` cannot be the zero address.
*/
function approve(address spender, uint256 value)
public
virtual
returns (bool)
{
address owner = _msgSender();
_approve(owner, spender, value);
return true;
}
/**
* @dev See {IERC20-transferFrom}.
*
* Skips emitting an {Approval} event indicating an allowance update. This is not
* required by the ERC. See {xref-ERC20-_approve-address-address-uint256-bool-}[_approve].
*
* NOTE: Does not update the allowance if the current allowance
* is the maximum `uint256`.
*
* Requirements:
*
* - `from` and `to` cannot be the zero address.
* - `from` must have a balance of at least `value`.
* - the caller must have allowance for ``from``'s tokens of at least
* `value`.
*/
function transferFrom(
address from,
address to,
uint256 value
) public virtual returns (bool) {
address spender = _msgSender();
_spendAllowance(from, spender, value);
_transfer(from, to, value);
return true;
}
/**
* @dev Moves a `value` amount of tokens from `from` to `to`.
*
* This internal function is equivalent to {transfer}, and can be used to
* e.g. implement automatic token fees, slashing mechanisms, etc.
*
* Emits a {Transfer} event.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _transfer(
address from,
address to,
uint256 value
) internal {
if (from == address(0)) {
revert ERC20InvalidSender(address(0));
}
if (to == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(from, to, value);
}
/**
* @dev Transfers a `value` amount of tokens from `from` to `to`, or alternatively mints (or burns) if `from`
* (or `to`) is the zero address. All customizations to transfers, mints, and burns should be done by overriding
* this function.
*
* Emits a {Transfer} event.
*/
function _update(
address from,
address to,
uint256 value
) internal virtual {
if (from == address(0)) {
// Overflow check required: The rest of the code assumes that totalSupply never overflows
_totalSupply += value;
} else {
uint256 fromBalance = _balances[from];
if (fromBalance < value) {
revert ERC20InsufficientBalance(from, fromBalance, value);
}
unchecked {
// Overflow not possible: value <= fromBalance <= totalSupply.
_balances[from] = fromBalance - value;
}
}
if (to == address(0)) {
unchecked {
// Overflow not possible: value <= totalSupply or value <= fromBalance <= totalSupply.
_totalSupply -= value;
}
} else {
unchecked {
// Overflow not possible: balance + value is at most totalSupply, which we know fits into a uint256.
_balances[to] += value;
}
}
emit Transfer(from, to, value);
}
/**
* @dev Creates a `value` amount of tokens and assigns them to `account`, by transferring it from address(0).
* Relies on the `_update` mechanism
*
* Emits a {Transfer} event with `from` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead.
*/
function _mint(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidReceiver(address(0));
}
_update(address(0), account, value);
}
/**
* @dev Destroys a `value` amount of tokens from `account`, lowering the total supply.
* Relies on the `_update` mechanism.
*
* Emits a {Transfer} event with `to` set to the zero address.
*
* NOTE: This function is not virtual, {_update} should be overridden instead
*/
function _burn(address account, uint256 value) internal {
if (account == address(0)) {
revert ERC20InvalidSender(address(0));
}
_update(account, address(0), value);
}
/**
* @dev Sets `value` as the allowance of `spender` over the `owner` s tokens.
*
* This internal function is equivalent to `approve`, and can be used to
* e.g. set automatic allowances for certain subsystems, etc.
*
* Emits an {Approval} event.
*
* Requirements:
*
* - `owner` cannot be the zero address.
* - `spender` cannot be the zero address.
*
* Overrides to this logic should be done to the variant with an additional `bool emitEvent` argument.
*/
function _approve(
address owner,
address spender,
uint256 value
) internal {
_approve(owner, spender, value, true);
}
/**
* @dev Variant of {_approve} with an optional flag to enable or disable the {Approval} event.
*
* By default (when calling {_approve}) the flag is set to true. On the other hand, approval changes made by
* `_spendAllowance` during the `transferFrom` operation set the flag to false. This saves gas by not emitting any
* `Approval` event during `transferFrom` operations.
*
* Anyone who wishes to continue emitting `Approval` events on the`transferFrom` operation can force the flag to
* true using the following override:
*
* ```solidity
* function _approve(address owner, address spender, uint256 value, bool) internal virtual override {
* super._approve(owner, spender, value, true);
* }
* ```
*
* Requirements are the same as {_approve}.
*/
function _approve(
address owner,
address spender,
uint256 value,
bool emitEvent
) internal virtual {
if (owner == address(0)) {
revert ERC20InvalidApprover(address(0));
}
if (spender == address(0)) {
revert ERC20InvalidSpender(address(0));
}
_allowances[owner][spender] = value;
if (emitEvent) {
emit Approval(owner, spender, value);
}
}
/**
* @dev Updates `owner` s allowance for `spender` based on spent `value`.
*
* Does not update the allowance value in case of infinite allowance.
* Revert if not enough allowance is available.
*
* Does not emit an {Approval} event.
*/
function _spendAllowance(
address owner,
address spender,
uint256 value
) internal virtual {
uint256 currentAllowance = allowance(owner, spender);
if (currentAllowance != type(uint256).max) {
if (currentAllowance < value) {
revert ERC20InsufficientAllowance(
spender,
currentAllowance,
value
);
}
unchecked {
_approve(owner, spender, currentAllowance - value, false);
}
}
}
}
// File: openzeppelin-contracts/contracts/access/Ownable.sol
// OpenZeppelin Contracts (last updated v5.0.0) (access/Ownable.sol)
pragma solidity ^0.8.20;
/**
* @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.
*
* The initial owner is set to the address provided by the deployer. 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;
/**
* @dev The caller account is not authorized to perform an operation.
*/
error OwnableUnauthorizedAccount(address account);
/**
* @dev The owner is not a valid owner account. (eg. `address(0)`)
*/
error OwnableInvalidOwner(address owner);
event OwnershipTransferred(
address indexed previousOwner,
address indexed newOwner
);
/**
* @dev Initializes the contract setting the address provided by the deployer as the initial owner.
*/
constructor(address initialOwner) {
if (initialOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_transferOwnership(initialOwner);
}
/**
* @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 {
if (owner() != _msgSender()) {
revert OwnableUnauthorizedAccount(_msgSender());
}
}
/**
* @dev Leaves the contract without owner. It will not be possible to call
* `onlyOwner` functions. Can only be called by the current owner.
*
* NOTE: Renouncing ownership will leave the contract without an owner,
* thereby disabling any functionality that is only available to the owner.
*/
function renounceOwnership() public virtual onlyOwner {
_transferOwnership(address(0));
}
/**
* @dev Transfers ownership of the contract to a new account (`newOwner`).
* Can only be called by the current owner.
*/
function transferOwnership(address newOwner) public virtual onlyOwner {
if (newOwner == address(0)) {
revert OwnableInvalidOwner(address(0));
}
_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: cubex.sol
pragma solidity >=0.6.2;
/*
██████╗██╗ ██╗██████╗ ███████╗██╗ ██╗ ██████╗ ███╗ ██╗███████╗
██╔════╝██║ ██║██╔══██╗██╔════╝╚██╗██╔╝ ██╔═══██╗████╗ ██║██╔════╝
██║ ██║ ██║██████╔╝█████╗ ╚███╔╝ ██║ ██║██╔██╗ ██║█████╗
██║ ██║ ██║██╔══██╗██╔══╝ ██╔██╗ ██║ ██║██║╚██╗██║██╔══╝
╚██████╗╚██████╔╝██████╔╝███████╗██╔╝ ██╗██╗╚██████╔╝██║ ╚████║███████╗
╚═════╝ ╚═════╝ ╚═════╝ ╚══════╝╚═╝ ╚═╝╚═╝ ╚═════╝ ╚═╝ ╚═══╝╚══════╝
*/
interface Router {
function factory() external view returns (address);
function positionManager() external view returns (address);
function WETH9() external view returns (address);
}
interface Factory {
function createPool(
address tokenA,
address tokenB,
uint24 fee
) external returns (address);
}
interface Pool {
function initialize(uint160 _sqrtPriceX96) external;
}
interface Params {
struct MintParams {
address token0;
address token1;
uint24 fee;
int24 tickLower;
int24 tickUpper;
uint256 amount0Desired;
uint256 amount1Desired;
uint256 amount0Min;
uint256 amount1Min;
address recipient;
uint256 deadline;
}
struct CollectParams {
uint256 tokenId;
address recipient;
uint128 amount0Max;
uint128 amount1Max;
}
}
interface PositionManager is Params {
function mint(MintParams calldata)
external
payable
returns (
uint256 tokenId,
uint128 liquidity,
uint256 amount0,
uint256 amount1
);
function collect(CollectParams calldata)
external
payable
returns (uint256 amount0, uint256 amount1);
function positions(uint256)
external
view
returns (
uint96 nonce,
address operator,
address token0,
address token1,
uint24 fee,
int24 tickLower,
int24 tickUpper,
uint128 liquidity,
uint256 feeGrowthInside0LastX128,
uint256 feeGrowthInside1LastX128,
uint128 tokensOwed0,
uint128 tokensOwed1
);
}
contract TickMath {
int24 internal constant MIN_TICK = -887272;
int24 internal constant MAX_TICK = -MIN_TICK;
uint160 internal constant MIN_SQRT_RATIO = 4295128739;
uint160 internal constant MAX_SQRT_RATIO =
1461446703485210103287273052203988822378723970342;
function _getSqrtRatioAtTick(int24 tick)
internal
pure
returns (uint160 sqrtPriceX96)
{
unchecked {
uint256 absTick = tick < 0
? uint256(-int256(tick))
: uint256(int256(tick));
require(absTick <= uint256(int256(MAX_TICK)), "T");
uint256 ratio = absTick & 0x1 != 0
? 0xfffcb933bd6fad37aa2d162d1a594001
: 0x100000000000000000000000000000000;
if (absTick & 0x2 != 0)
ratio = (ratio * 0xfff97272373d413259a46990580e213a) >> 128;
if (absTick & 0x4 != 0)
ratio = (ratio * 0xfff2e50f5f656932ef12357cf3c7fdcc) >> 128;
if (absTick & 0x8 != 0)
ratio = (ratio * 0xffe5caca7e10e4e61c3624eaa0941cd0) >> 128;
if (absTick & 0x10 != 0)
ratio = (ratio * 0xffcb9843d60f6159c9db58835c926644) >> 128;
if (absTick & 0x20 != 0)
ratio = (ratio * 0xff973b41fa98c081472e6896dfb254c0) >> 128;
if (absTick & 0x40 != 0)
ratio = (ratio * 0xff2ea16466c96a3843ec78b326b52861) >> 128;
if (absTick & 0x80 != 0)
ratio = (ratio * 0xfe5dee046a99a2a811c461f1969c3053) >> 128;
if (absTick & 0x100 != 0)
ratio = (ratio * 0xfcbe86c7900a88aedcffc83b479aa3a4) >> 128;
if (absTick & 0x200 != 0)
ratio = (ratio * 0xf987a7253ac413176f2b074cf7815e54) >> 128;
if (absTick & 0x400 != 0)
ratio = (ratio * 0xf3392b0822b70005940c7a398e4b70f3) >> 128;
if (absTick & 0x800 != 0)
ratio = (ratio * 0xe7159475a2c29b7443b29c7fa6e889d9) >> 128;
if (absTick & 0x1000 != 0)
ratio = (ratio * 0xd097f3bdfd2022b8845ad8f792aa5825) >> 128;
if (absTick & 0x2000 != 0)
ratio = (ratio * 0xa9f746462d870fdf8a65dc1f90e061e5) >> 128;
if (absTick & 0x4000 != 0)
ratio = (ratio * 0x70d869a156d2a1b890bb3df62baf32f7) >> 128;
if (absTick & 0x8000 != 0)
ratio = (ratio * 0x31be135f97d08fd981231505542fcfa6) >> 128;
if (absTick & 0x10000 != 0)
ratio = (ratio * 0x9aa508b5b7a84e1c677de54f3e99bc9) >> 128;
if (absTick & 0x20000 != 0)
ratio = (ratio * 0x5d6af8dedb81196699c329225ee604) >> 128;
if (absTick & 0x40000 != 0)
ratio = (ratio * 0x2216e584f5fa1ea926041bedfe98) >> 128;
if (absTick & 0x80000 != 0)
ratio = (ratio * 0x48a170391f7dc42444e8fa2) >> 128;
if (tick > 0) ratio = type(uint256).max / ratio;
sqrtPriceX96 = uint160(
(ratio >> 32) + (ratio % (1 << 32) == 0 ? 0 : 1)
);
}
}
function _getTickAtSqrtRatio(uint160 sqrtPriceX96)
internal
pure
returns (int24 tick)
{
unchecked {
require(
sqrtPriceX96 >= MIN_SQRT_RATIO && sqrtPriceX96 < MAX_SQRT_RATIO,
"R"
);
uint256 ratio = uint256(sqrtPriceX96) << 32;
uint256 r = ratio;
uint256 msb = 0;
assembly {
let f := shl(7, gt(r, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := shl(6, gt(r, 0xFFFFFFFFFFFFFFFF))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := shl(5, gt(r, 0xFFFFFFFF))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := shl(4, gt(r, 0xFFFF))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := shl(3, gt(r, 0xFF))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := shl(2, gt(r, 0xF))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := shl(1, gt(r, 0x3))
msb := or(msb, f)
r := shr(f, r)
}
assembly {
let f := gt(r, 0x1)
msb := or(msb, f)
}
if (msb >= 128) r = ratio >> (msb - 127);
else r = ratio << (127 - msb);
int256 log_2 = (int256(msb) - 128) << 64;
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(63, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(62, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(61, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(60, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(59, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(58, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(57, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(56, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(55, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(54, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(53, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(52, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(51, f))
r := shr(f, r)
}
assembly {
r := shr(127, mul(r, r))
let f := shr(128, r)
log_2 := or(log_2, shl(50, f))
}
int256 log_sqrt10001 = log_2 * 255738958999603826347141;
int24 tickLow = int24(
(log_sqrt10001 - 3402992956809132418596140100660247210) >> 128
);
int24 tickHi = int24(
(log_sqrt10001 + 291339464771989622907027621153398088495) >> 128
);
tick = tickLow == tickHi
? tickLow
: _getSqrtRatioAtTick(tickHi) <= sqrtPriceX96
? tickHi
: tickLow;
}
}
function _sqrt(uint256 _n) internal pure returns (uint256 result) {
unchecked {
uint256 _tmp = (_n + 1) / 2;
result = _n;
while (_tmp < result) {
result = _tmp;
_tmp = (_n / _tmp + _tmp) / 2;
}
}
}
function _getPriceAndTickFromValues(
bool _weth0,
uint256 _tokens,
uint256 _weth
) internal pure returns (uint160 price, int24 tick) {
uint160 _tmpPrice = uint160(
_sqrt(
(2**192 / (!_weth0 ? _tokens : _weth)) *
(_weth0 ? _tokens : _weth)
)
);
tick = _getTickAtSqrtRatio(_tmpPrice);
tick = tick - (tick % 200);
price = _getSqrtRatioAtTick(tick);
}
}
contract CubeX is ERC20, Ownable, TickMath, Params {
Router public constant ROUTER =
Router(0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45);
uint256[] initialMCs;
uint256[] upperMCs;
address[] pairedTokens;
uint256[] private liquidityPositions;
address[] public pools;
uint256 public interval = 1 days;
uint256 public nextClaim;
uint256 public tokenSupply;
mapping(address => bool) public usedTokens;
mapping(address => mapping(uint24 => bool)) public feesUsed;
constructor(
string memory _name,
string memory _symbol,
uint256 _tokenSupply,
address _volumeToken,
uint256[] memory _lowHigh,
uint256[] memory _lowHighCube
) ERC20(_name, _symbol) Ownable(msg.sender) {
tokenSupply = _tokenSupply;
address _this = address(this);
uint24 fee = 10000;
// Volume token
pairedTokens.push(_volumeToken);
initialMCs.push(_lowHigh[0]); // ~$12k
upperMCs.push(_lowHigh[1]); // ~$1.29B
(uint160 _initialSqrtPrice, ) = _getPriceAndTickFromValues(
pairedTokens[0] < _this,
_tokenSupply,
initialMCs[0]
); // gets price
pools.push(
Factory(ROUTER.factory()).createPool(_this, pairedTokens[0], fee)
); // starts pool with 1% fee
Pool(pools[0]).initialize(_initialSqrtPrice); // Set the pool pricing
// DAI
pairedTokens.push(0x6B175474E89094C44Da98b954EedeAC495271d0F);
initialMCs.push(12938500000000000000000); // ~$12k
upperMCs.push(1293850000000000000000000000); // ~$1.29B
(_initialSqrtPrice, ) = _getPriceAndTickFromValues(
pairedTokens[1] < _this,
_tokenSupply,
initialMCs[1]
);
pools.push(
Factory(ROUTER.factory()).createPool(_this, pairedTokens[1], fee)
);
Pool(pools[1]).initialize(_initialSqrtPrice);
// CUBE
pairedTokens.push(0x73A740d256188395D9AF56db31AB1e9Bb2F2978D);
initialMCs.push(_lowHighCube[0]);
upperMCs.push(_lowHighCube[1]);
(_initialSqrtPrice, ) = _getPriceAndTickFromValues(
pairedTokens[2] < _this,
_tokenSupply,
initialMCs[2]
);
pools.push(
Factory(ROUTER.factory()).createPool(_this, pairedTokens[2], fee)
);
Pool(pools[2]).initialize(_initialSqrtPrice);
nextClaim = block.timestamp + interval;
}
function initialize() external {
require(totalSupply() == 0);
_mint(address(this), tokenSupply);
uint256 amount = tokenSupply / pairedTokens.length;
for (uint256 i = 0; i < pairedTokens.length; i++) {
if (totalSupply() >= amount) {
_position(
initialMCs[i],
upperMCs[i],
tokenSupply / pairedTokens.length,
pairedTokens[i],
10000
);
feesUsed[pairedTokens[i]][10000] = true;
usedTokens[pairedTokens[i]] = true;
}
}
}
function _position(
uint256 lower,
uint256 up,
uint256 supply,
address _token,
uint24 fee
) internal {
address _this = address(this);
bool _token0 = _token < _this; // token0 is the lesser address()
nextClaim = block.timestamp + interval;
(, int24 _minTick) = _getPriceAndTickFromValues(
_token0,
tokenSupply,
lower
);
(, int24 _maxTick) = _getPriceAndTickFromValues(
_token0,
tokenSupply,
up
);
liquidityPositions.push(
_createNewPosition(
_token,
_this,
_token0,
_token0 ? _maxTick : _minTick, // LowerTick
!_token0 ? _maxTick : _minTick, // UpperTick
supply > balanceOf(_this) ? balanceOf(_this) : supply,
fee
)
);
}
function _createNewPosition(
address _token,
address _this,
bool _token0,
int24 _tickLower,
int24 _tickUpper,
uint256 amount,
uint24 _fee
) internal returns (uint256 a) {
PositionManager _pm = PositionManager(ROUTER.positionManager());
_approve(_this, address(_pm), amount);
(a, , , ) = _pm.mint(
MintParams({
token0: _token0 ? _token : _this,
token1: !_token0 ? _token : _this,
fee: _fee,
tickLower: _tickLower,
tickUpper: _tickUpper,
amount0Desired: _token0 ? 0 : amount,
amount1Desired: !_token0 ? 0 : amount,
amount0Min: 0,
amount1Min: 0,
recipient: _this,
deadline: block.timestamp
})
);
}
function createNewPosition(
address token,
uint256 lowerMC,
uint256 upperMC,
uint24 fee
) public onlyOwner {
require(upperMC > lowerMC, "Fix MC");
require(!feesUsed[token][fee], "Token Already Used");
feesUsed[token][fee] = true;
address _this = address(this);
(uint160 _initialSqrtPrice, ) = _getPriceAndTickFromValues(
token < _this,
tokenSupply,
lowerMC
);
address npool = Factory(ROUTER.factory()).createPool(
_this,
token,
10000
); // starts pool with 1% fee
Pool(npool).initialize(_initialSqrtPrice); // Set the pool pricing
pools.push(npool);
_position(lowerMC, upperMC, balanceOf(_this), token, fee);
if (!usedTokens[token]) {
pairedTokens.push(token);
usedTokens[token] = true;
}
}
function claimFees() public {
require(nextClaim < block.timestamp, "Not enough time has passed");
nextClaim = block.timestamp + interval;
_claimFees();
for (uint256 i = 0; i < pairedTokens.length; ) {
IERC20 t = IERC20(pairedTokens[i]);
uint256 _amount = t.balanceOf(address(this));
if (_amount > 0) {
t.transfer(msg.sender, _amount / 50);
t.transfer(owner(), t.balanceOf(address(this)));
}
unchecked {
i++;
}
}
uint256 amount = address(this).balance;
if (amount > 50) {
address payable m = payable(msg.sender);
bool f;
f = m.send(amount / 50);
address payable o = payable(owner());
f = o.send(address(this).balance);
}
}
function _claimFees() internal {
for (uint256 i = 0; i < liquidityPositions.length; ) {
_claim(liquidityPositions[i]);
unchecked {
i++;
}
}
}
function _claim(uint256 pos) internal {
PositionManager _pm = PositionManager(ROUTER.positionManager());
uint128 Uint128Max = type(uint128).max;
_pm.collect(
CollectParams({
tokenId: pos,
recipient: address(this),
amount0Max: Uint128Max,
amount1Max: Uint128Max
})
);
}
function claim() external onlyOwner {
_claimFees();
nextClaim = block.timestamp + interval;
for (uint256 i = 0; i < pairedTokens.length; ) {
IERC20 t = IERC20(pairedTokens[i]);
if (t.balanceOf(address(this)) > 0) {
t.transfer(msg.sender, t.balanceOf(address(this)));
}
unchecked {
i++;
}
}
uint256 amount = address(this).balance;
if (amount > 0) {
address payable o = payable(owner());
bool f;
f = o.send(amount);
}
}
receive() external payable {}
function liquidityPositons() external view returns (uint256[] memory) {
return liquidityPositions;
}
function claimSpecficPositions(uint256[] memory positions) external {
for (uint256 i = 0; i < positions.length; ) {
_claim(positions[i]);
unchecked {
i++;
}
}
}
function erc20Withdrawal(address[] memory tokens) external onlyOwner {
address _this = address(this);
for (uint256 i = 0; i < tokens.length; ) {
require(tokens[i] != _this, "Cannot withdraw contract token");
IERC20 t = IERC20(tokens[i]);
t.transfer(msg.sender, t.balanceOf(_this));
unchecked {
i++;
}
}
uint256 amount = address(this).balance;
if (amount > 0) {
address payable o = payable(owner());
bool f;
f = o.send(amount);
}
}
function pairedTokensView() public view returns (address[] memory) {
return pairedTokens;
}
}
Read Contract
ROUTER 0x32fe7b26 → address
allowance 0xdd62ed3e → uint256
balanceOf 0x70a08231 → uint256
decimals 0x313ce567 → uint8
feesUsed 0x8c4fd486 → bool
interval 0x947a36fb → uint256
liquidityPositons 0x18f3b92a → uint256[]
name 0x06fdde03 → string
nextClaim 0xe444504c → uint256
owner 0x8da5cb5b → address
pairedTokensView 0xd5c11e30 → address[]
pools 0xac4afa38 → address
symbol 0x95d89b41 → string
tokenSupply 0x7824407f → uint256
totalSupply 0x18160ddd → uint256
usedTokens 0x3659ffb2 → bool
Write Contract 11 functions
These functions modify contract state and require a wallet transaction to execute.
approve 0x095ea7b3
address spender
uint256 value
returns: bool
claim 0x4e71d92d
No parameters
claimFees 0xd294f093
No parameters
claimSpecficPositions 0xdff7e3cb
uint256[] positions
createNewPosition 0xd2ab71f5
address token
uint256 lowerMC
uint256 upperMC
uint24 fee
erc20Withdrawal 0xbdd859ce
address[] tokens
initialize 0x8129fc1c
No parameters
renounceOwnership 0x715018a6
No parameters
transfer 0xa9059cbb
address to
uint256 value
returns: bool
transferFrom 0x23b872dd
address from
address to
uint256 value
returns: bool
transferOwnership 0xf2fde38b
address newOwner
Recent Transactions
No transactions found for this address