Address Contract Partially Verified
Address
0xE1AD7F48198D4e90D8eCb5E8aB3e8987C7B6ADA5
Balance
0 ETH
Nonce
1
Code Size
23661 bytes
Creator
0x29BfF390...337a at tx 0x399350b8...9bb84a
Indexed Transactions
0
Contract Bytecode
23661 bytes
0x608060405234801561001057600080fd5b506004361061030b5760003560e01c806385d9aabb1161019d578063ac4afa38116100e9578063d6f58088116100a2578063e99f5b801161007c578063e99f5b8014610b1b578063f247c4b014610b41578063f2fde38b14610b49578063f3f14ed014610b6f5761030b565b8063d6f5808814610ad0578063d808b83414610aed578063d8f14f2b14610b135761030b565b8063ac4afa381461092c578063b4b5ea571461098e578063b9d02df4146109b4578063bfd05aaa14610a1e578063cfc2cb6014610a44578063d13f90b414610a8e5761030b565b806394f70aca116101565780639ee5dd88116101305780639ee5dd8814610880578063a153d96514610888578063a41fe49f146108dd578063ab85cfe4146109065761030b565b806394f70aca14610820578063996517a51461083d5780639c954c9d146108635761030b565b806385d9aabb14610731578063866bf7ae1461077e5780638cd0d629146107865780638da5cb5b146107ba5780638e782f4d146107c2578063932bb0a1146107ee5761030b565b80635312ea8e1161025c5780636aa7098c116102155780637733fdbb116101ef5780637733fdbb14610651578063782d6fe1146106a75780637ca81460146106d35780637cd07e47146107295761030b565b80636aa7098c146105cf578063715018a61461060f5780637644c30f146106175761030b565b80635312ea8e146104e357806356b2ed53146105005780635754f8d6146105265780635c19a95c146105735780635c2ef9a314610599578063630b5ba1146105c75761030b565b80631e31d053116102c957806334940fa8116102a357806334940fa814610420578063430bf6df1461048157806348cd4cb1146104a557806351eb05a6146104c65761030b565b80631e31d053146103d357806323868491146103db57806323cf3118146103fa5761030b565b8062aeef8a146103105780630795debe1461033b578063081e3eda1461037d578063151e6aa51461039757806317caf6f11461039f5780631db56032146103a7575b600080fd5b6103396004803603606081101561032657600080fd5b5080359060208101359060400135610b95565b005b6103616004803603602081101561035157600080fd5b50356001600160a01b0316610ed3565b604080516001600160a01b039092168252519081900360200190f35b610385610eef565b60408051918252519081900360200190f35b610361610ef6565b610385610f06565b610385600480360360408110156103bd57600080fd5b50803590602001356001600160a01b0316610f0d565b61036161113c565b610339600480360360208110156103f157600080fd5b50351515611160565b6103396004803603602081101561041057600080fd5b50356001600160a01b03166111ec565b6104526004803603604081101561043657600080fd5b5080356001600160a01b0316906020013563ffffffff16611297565b6040805163ffffffff90941684526001600160601b039283166020850152911682820152519081900360600190f35b6104896112c2565b604080516001600160601b039092168252519081900360200190f35b6104ad6112d9565b6040805163ffffffff9092168252519081900360200190f35b610339600480360360208110156104dc57600080fd5b50356112ed565b610339600480360360208110156104f957600080fd5b5035611377565b6103396004803603602081101561051657600080fd5b50356001600160a01b031661158f565b6105436004803603602081101561053c57600080fd5b50356115e7565b60408051958652602086019490945263ffffffff9092168484015260608401526080830152519081900360a00190f35b6103396004803603602081101561058957600080fd5b50356001600160a01b031661161e565b610339600480360360408110156105af57600080fd5b506001600160a01b0381358116916020013516611673565b610339611723565b610489600480360360808110156105e557600080fd5b506001600160a01b038135169060208101359063ffffffff60408201358116916060013516611747565b610339611787565b61063d6004803603602081101561062d57600080fd5b50356001600160a01b0316611829565b604080519115158252519081900360200190f35b610339600480360361010081101561066857600080fd5b508035906001600160a01b036020820135169060ff60408201351690606081013515159060808101359060a08101359060c08101359060e0013561183f565b610489600480360360408110156106bd57600080fd5b506001600160a01b038135169060200135611c18565b6106f9600480360360208110156106e957600080fd5b50356001600160a01b0316611c52565b6040805163ffffffff94851681529290931660208301526001600160a01b03168183015290519081900360600190f35b610361611c89565b610339600480360361010081101561074857600080fd5b5080359060208101359060ff60408201351690606081013515159060808101359060a08101359060c08101359060e00135611ca0565b6104ad611f44565b6103856004803603606081101561079c57600080fd5b508035906001600160a01b0360208201351690604001351515611f58565b610361611fb2565b610385600480360360408110156107d857600080fd5b50803590602001356001600160a01b0316611fc1565b61063d6004803603606081101561080457600080fd5b50803590602081013590604001356001600160a01b031661222b565b6103396004803603602081101561083657600080fd5b5035612257565b6103856004803603602081101561085357600080fd5b50356001600160a01b031661232d565b6103396004803603602081101561087957600080fd5b5035612340565b610339612434565b6108b46004803603604081101561089e57600080fd5b506001600160a01b038135169060200135612603565b604051808363ffffffff1681526020018263ffffffff1681526020019250505060405180910390f35b610339600480360360608110156108f357600080fd5b50803590602081013590604001356126ae565b61063d6004803603602081101561091c57600080fd5b50356001600160a01b0316612a19565b6109496004803603602081101561094257600080fd5b5035612a7d565b604080516001600160a01b039097168752941515602087015260ff9093168585015263ffffffff918216606086015216608084015260a0830152519081900360c00190f35b610489600480360360208110156109a457600080fd5b50356001600160a01b0316612ae1565b6109e0600480360360408110156109ca57600080fd5b50803590602001356001600160a01b0316612b13565b6040805163ffffffff96871681529490951660208501526001600160601b039283168486015291166060830152608082015290519081900360a00190f35b61038560048036036020811015610a3457600080fd5b50356001600160a01b0316612b67565b610a7060048036036040811015610a5a57600080fd5b50803590602001356001600160a01b0316612b7a565b6040805192835263ffffffff90911660208301528051918290030190f35b610339600480360360a0811015610aa457600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060800135612ba5565b61033960048036036020811015610ae657600080fd5b5035612d57565b61038560048036036020811015610b0357600080fd5b50356001600160a01b0316612dfb565b610361612e0e565b61038560048036036020811015610b3157600080fd5b50356001600160a01b0316612e1e565b610489612e31565b61033960048036036020811015610b5f57600080fd5b50356001600160a01b0316612e41565b61038560048036036020811015610b8557600080fd5b50356001600160a01b0316612f3a565b60975460ff16610bda576040805162461bcd60e51b815260206004820152601f6024820152600080516020615abb833981519152604482015290519081900360640190fd5b6097805460ff19169055610bed83612f4d565b610bf5612fa4565b60006101648481548110610c0557fe5b6000918252602080832087845261016a825260408085206101668452818620338088529085528287208b885261016b865283882091885294529420600290930201935090610c53848461307e565b610c5f82858386613311565b8515610c91578354610c7c906001600160a01b0316333089613612565b6001820154610c8b9087613672565b60018301555b8415610cff5761016154610cb0906001600160a01b0316333088613612565b8054610cbc9086613672565b815583546001600160a01b0316600090815261016f6020526040902054610ce39086613672565b84546001600160a01b0316600090815261016f60205260409020555b805415610d6457805460018301548554610d239291906001600160a01b031661222b565b15610d64576040805162461bcd60e51b815260206004820152600c60248201526b424f4f53545f424f554e445360a01b604482015290519081900360640190fd5b6001808301546040805160c08101825287546001600160a01b038116825260ff600160a01b820481161515602080850191909152600160a81b83049091168385015263ffffffff600160b01b83048116606080860191909152600160d01b90930481166080808601919091528b88015460a080870191909152865180880188528a5481528a8a0154841681860152875191820188528c548252988c01549381019390935260028b015490911694820194909452600389015491810191909152600488015492810192909252610e3a9390916136cc565b82546001600160601b0391909116600160a01b026001600160a01b0390911617825560408051878152602081018790528151899233927f36af321ec8d3c75236829c5317affd40ddb308863a1236d2d277a4025cccee1e929081900390910190a333600090815261016e602052604090205460ff1615610ebd57610ebd33613749565b50506097805460ff191660011790555050505050565b610168602052600090815260409020546001600160a01b031681565b6101645490565b610162546001600160a01b031681565b6101675481565b6000610f176159eb565b6101648481548110610f2557fe5b60009182526020918290206040805160c081018252600290930290910180546001600160a01b038116845260ff600160a01b82048116151595850195909552600160a81b81049094169183019190915263ffffffff600160b01b840481166060840152600160d01b909304909216608082015260019091015460a08201529050610fad615a20565b50600084815261016a6020908152604091829020825160a08101845281548152600182015492810192909252600281015463ffffffff1692820192909252600382015460608201526004909101546080820152611008615a55565b506000858152610166602090815260408083206001600160a01b0388168452825291829020825160a081018452815463ffffffff8082168352600160201b820416938201939093526001600160601b03600160401b8404811694820194909452600160a01b9092049092166060820152600190910154608082015261108b615a83565b50600086815261016b602090815260408083206001600160a01b03891684528252918290208251808401909352805483526001015463ffffffff16908201526110d384613d41565b506110e2838560000151613db9565b5061016487815481106110f157fe5b6000918252602090912060029091020154600160d01b900463ffffffff16608085015261111e8484613e0b565b50600061112d83868487613e51565b96505050505050505b92915050565b33600090815261012d6020526040902054600160401b90046001600160a01b031690565b60975460ff166111a5576040805162461bcd60e51b815260206004820152601f6024820152600080516020615abb833981519152604482015290519081900360640190fd5b6097805460ff1990811690915533600090815261016e60205260409020805483158015919093161790556111dc576111dc33613749565b506097805460ff19166001179055565b6111f461412d565b6065546001600160a01b03908116911614611244576040805162461bcd60e51b81526020600482018190526024820152600080516020615b90833981519152604482015290519081900360640190fd5b61016380546001600160601b0316600160601b6001600160a01b038416908102919091179091556040517ff40543f3e605deae7fbca26db18ff1de07eda2925d68655836eae4c167444e3290600090a250565b6000806000806112a78686614131565b90945090506112b58161416a565b9497909650939450505050565b61016154600160a01b90046001600160601b031681565b61016254600160c01b900463ffffffff1681565b60975460ff16611332576040805162461bcd60e51b815260206004820152601f6024820152600080516020615abb833981519152604482015290519081900360640190fd5b6097805460ff1916905561016480546111dc91908390811061135057fe5b906000526020600020906002020161016a600084815260200190815260200160002061307e565b60975460ff166113bc576040805162461bcd60e51b815260206004820152601f6024820152600080516020615abb833981519152604482015290519081900360640190fd5b6097805460ff191690556113cf81612f4d565b6113d7612fa4565b600061016482815481106113e757fe5b60009182526020808320858452610166825260408085203380875290845281862088875261016b8552828720828852909452942060018301546002909402909101805490955091939092611445926001600160a01b0316919061417f565b80541561146957805461016154611469916001600160a01b0390911690339061417f565b600182015481546040805192835260208301919091528051869233927f2369db1bafee945aee5630782f4a170682e3f8188d8dc247a4c73eb8c9e692d292918290030190a38154600160401b90046001600160601b03161561154757610161548254600160a01b9091046001600160601b03908116600160401b909204161161151c5781546101615461151791600160a01b9091046001600160601b0390811691600160401b9004166141d6565b61151f565b60005b61016160146101000a8154816001600160601b0302191690836001600160601b031602179055505b600060018301819055825463ffffffff16835580825533815261016e602052604090205460ff161561157c5761157c33613749565b50506097805460ff191660011790555050565b60975460ff166115d4576040805162461bcd60e51b815260206004820152601f6024820152600080516020615abb833981519152604482015290519081900360640190fd5b6097805460ff191690556111dc81613749565b61016a60205260009081526040902080546001820154600283015460038401546004909401549293919263ffffffff909116919085565b6001600160a01b0381163014156116665760405162461bcd60e51b8152600401808060200182810382526030815260200180615c086030913960400191505060405180910390fd5b6116703382614218565b50565b61167b61412d565b6065546001600160a01b039081169116146116cb576040805162461bcd60e51b81526020600482018190526024820152600080516020615b90833981519152604482015290519081900360640190fd5b6001600160a01b038281166000818152610168602052604080822080546001600160a01b0319169486169485179055517fb7b89eb0ea057d36260d49cabb87830afa2a5fcfe748fe2ae71de060b6410f939190a35050565b6101645460005b818110156117435761173b816112ed565b60010161172a565b5050565b6001600160a01b038416600090815261016e602052604081205460ff166117705750600061177f565b61177c85858585614295565b90505b949350505050565b61178f61412d565b6065546001600160a01b039081169116146117df576040805162461bcd60e51b81526020600482018190526024820152600080516020615b90833981519152604482015290519081900360640190fd5b6065546040516000916001600160a01b0316907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3606580546001600160a01b0319169055565b61016e6020526000908152604090205460ff1681565b61184761412d565b6065546001600160a01b03908116911614611897576040805162461bcd60e51b81526020600482018190526024820152600080516020615b90833981519152604482015290519081900360640190fd5b6118a087612a19565b156118f2576040805162461bcd60e51b815260206004820152601e60248201527f564c504d696e696e673a20746f6b656e20616c72656164792061646465640000604482015290519081900360640190fd5b6118fa611723565b6000611904614350565b6101625490915060009063ffffffff600160c01b90910481169083161161193b5761016254600160c01b900463ffffffff1661193d565b815b6101675490915061194e908b613672565b6101678190555060006101648054905090506101646040518060c001604052808c6001600160a01b031681526020018a151581526020018b60ff1681526020016119cd8e6040518060400160405280601d81526020017f564c504d696e696e673a20746f6f2062696720616c6c6f636174696f6e000000815250614396565b63ffffffff1681526020018463ffffffff1681526020016000815250908060018154018082558091505060019003906000526020600020906002020160009091909190915060008201518160000160006101000a8154816001600160a01b0302191690836001600160a01b0316021790555060208201518160000160146101000a81548160ff02191690831515021790555060408201518160000160156101000a81548160ff021916908360ff16021790555060608201518160000160166101000a81548163ffffffff021916908363ffffffff160217905550608082015181600001601a6101000a81548163ffffffff021916908363ffffffff16021790555060a0820151816001015550508061016560008c6001600160a01b03166001600160a01b03168152602001908152602001600020819055508661016a6000838152602001908152602001600020600001819055508561016a6000838152602001908152602001600020600101819055508161016a600083815260200190815260200160002060020160006101000a81548163ffffffff021916908363ffffffff1602179055508461016c60008c6001600160a01b03166001600160a01b03168152602001908152602001600020819055508361016d60008c6001600160a01b03166001600160a01b0316815260200190815260200160002081905550808a6001600160a01b03167f4ca3b1f4222c9ac99ea2eb1c68764056287a101a2f63d81e21c3a7ccfcef36e48d6040518082815260200191505060405180910390a35050505050505050505050565b6001600160a01b038216600090815261016e602052604081205460ff16611c4157506000611136565b611c4b8383614430565b9392505050565b61012d6020526000908152604090205463ffffffff80821691600160201b810490911690600160401b90046001600160a01b031683565b61016354600160601b90046001600160a01b031681565b611ca861412d565b6065546001600160a01b03908116911614611cf8576040805162461bcd60e51b81526020600482018190526024820152600080516020615b90833981519152604482015290519081900360640190fd5b611d00611723565b611d4787611d416101648b81548110611d1557fe5b6000918252602090912060029091020154610167549063ffffffff600160b01b90910481169061443f16565b90613672565b6101675560408051808201909152601d81527f564c504d696e696e673a20746f6f2062696720616c6c6f636174696f6e0000006020820152611d8a908890614396565b6101648981548110611d9857fe5b906000526020600020906002020160000160166101000a81548163ffffffff021916908363ffffffff160217905550846101648981548110611dd657fe5b906000526020600020906002020160000160146101000a81548160ff021916908315150217905550856101648981548110611e0d57fe5b600091825260208083206002909202909101805460ff94909416600160a81b0260ff60a81b199094169390931790925589815261016a909152604081208581556001018490556101648054849261016c9290918c908110611e6a57fe5b600091825260208083206002909202909101546001600160a01b031683528201929092526040018120919091556101648054839261016d9290918c908110611eae57fe5b600091825260208083206002909202909101546001600160a01b03168352820192909252604001902055610164805489919082908110611eea57fe5b600091825260209182902060029091020154604080518b815290516001600160a01b03909216927f0e6fb68a420d604687d312365a9cb09a342eecccc96c0dc3283dbdbb070ce10392918290030190a35050505050505050565b61016254600160a01b900463ffffffff1681565b600061177f64e8d4a51000611fac84611f8a576001600160a01b038616600090815261016d6020526040902054611fa5565b6001600160a01b038616600090815261016c60205260409020545b8790614481565b906144da565b6065546001600160a01b031690565b610164546000908310611fd657506000611136565b611fde6159eb565b6101648481548110611fec57fe5b60009182526020918290206040805160c081018252600290930290910180546001600160a01b038116845260ff600160a01b82048116151595850195909552600160a81b81049094169183019190915263ffffffff600160b01b840481166060840152600160d01b909304909216608082015260019091015460a08201529050612074615a20565b50600084815261016a6020908152604091829020825160a08101845281548152600182015492810192909252600281015463ffffffff16928201929092526003820154606082015260049091015460808201526120cf615a55565b506000858152610166602090815260408083206001600160a01b0388168452825291829020825160a081018452815463ffffffff8082168352600160201b820416938201939093526001600160601b03600160401b8404811694820194909452600160a01b90920490921660608201526001909101546080820152612152615a83565b50600086815261016b602090815260408083206001600160a01b03891684528252918290208251808401909352805483526001015463ffffffff169082015261219a84613d41565b506121a9838560000151613db9565b5061016487815481106121b857fe5b6000918252602090912060029091020154600160d01b900463ffffffff1660808501526121e58484613e0b565b5060006121f48386848761451c565b90506122168360400151826001600160601b031661459190919063ffffffff16565b6001600160601b031698975050505050505050565b600061223983836001611f58565b84108061177f575061224d83836000611f58565b9093119392505050565b61225f61412d565b6065546001600160a01b039081169116146122af576040805162461bcd60e51b81526020600482018190526024820152600080516020615b90833981519152604482015290519081900360640190fd5b6122d1816040518060600160405280602b8152602001615b01602b9139614396565b610162805463ffffffff92909216600160a01b0263ffffffff60a01b199092169190911790556040805182815290517fb6d927d1177d65639186d960a1926f0aa9cd35eca2b1b244e62f50fe3bff99a09181900360200190a150565b61016c6020526000908152604090205481565b61234861412d565b6065546001600160a01b03908116911614612398576040805162461bcd60e51b81526020600482018190526024820152600080516020615b90833981519152604482015290519081900360640190fd5b6123d7816040518060400160405280601e81526020017f564c504d696e696e673a20746f6f2062696720637670506572426c6f636b00008152506145d3565b61016380546bffffffffffffffffffffffff19166001600160601b03929092169190911790556040805182815290517f11d360a0021a6a2561238805127962df1163ba47bfd43d6936083b0e0029c88d916020908290030190a150565b61243c61412d565b6065546001600160a01b0390811691161461248c576040805162461bcd60e51b81526020600482018190526024820152600080516020615b90833981519152604482015290519081900360640190fd5b600a6124966159eb565b61016482815481106124a457fe5b600091825260208083206040805160c081018252600290940290910180546001600160a01b03811680865260ff600160a01b83048116151587870152600160a81b8304168685015263ffffffff600160b01b830481166060880152600160d01b909204909116608086015260019091015460a0850152845261016f909152909120549091501561256d576040805162461bcd60e51b815260206004820152600f60248201526e1053149150511657d5541110551151608a1b604482015290519081900360640190fd5b61016154604080516370a0823160e01b815230600482015290516001600160a01b03909216916370a0823191602480820192602092909190829003018186803b1580156125b957600080fd5b505afa1580156125cd573d6000803e3d6000fd5b505050506040513d60208110156125e357600080fd5b505190516001600160a01b0316600090815261016f602052604090205550565b6000806001600160a01b038416612661576040805162461bcd60e51b815260206004820152601d60248201527f66696e64436865636b706f696e74733a207a65726f206163636f756e74000000604482015290519081900360640190fd5b6001600160a01b038416600090815261012d602052604090206126849084614628565b5030600090815261012d602052604090209092506126a29084614628565b50809150509250929050565b60975460ff166126f3576040805162461bcd60e51b815260206004820152601f6024820152600080516020615abb833981519152604482015290519081900360640190fd5b6097805460ff1916905561270683612f4d565b61270e612fa4565b6000610164848154811061271e57fe5b6000918252602080832087845261016a825260408085206101668452818620338088529085528287208b885261016b86528388209188529452942060018301546002909402909101945090918611156127a85760405162461bcd60e51b8152600401808060200182810382526021815260200180615b4e6021913960400191505060405180910390fd5b6127b2848461307e565b6127be82858386613311565b85156127ee5760018201546127d3908761443f565b600183015583546127ee906001600160a01b0316338861417f565b841561285b578054612800908661443f565b81556101615461281a906001600160a01b0316338761417f565b83546001600160a01b0316600090815261016f602052604090205461283f908661443f565b84546001600160a01b0316600090815261016f60205260409020555b8054156128c05780546001830154855461287f9291906001600160a01b031661222b565b156128c0576040805162461bcd60e51b815260206004820152600c60248201526b424f4f53545f424f554e445360a01b604482015290519081900360640190fd5b6001808301546040805160c08101825287546001600160a01b038116825260ff600160a01b820481161515602080850191909152600160a81b83049091168385015263ffffffff600160b01b83048116606080860191909152600160d01b90930481166080808601919091528b88015460a080870191909152865180880188528a5481528a8a0154841681860152875191820188528c548252988c01549381019390935260028b0154909116948201949094526003890154918101919091526004880154928101929092526129969390916136cc565b82546001600160601b0391909116600160a01b026001600160a01b0390911617825560408051878152602081018790528151899233927f02f25270a4d87bea75db541cdfe559334a275b4a233520ed6c0a2429667cca94929081900390910190a333600090815261016e602052604090205460ff1615610ebd57610ebd33613749565b6001600160a01b038116600090815261016560205260408120546101645481108015612a745750826001600160a01b03166101648281548110612a5857fe5b60009182526020909120600290910201546001600160a01b0316145b9150505b919050565b6101648181548110612a8b57fe5b6000918252602090912060029091020180546001909101546001600160a01b038216925060ff600160a01b8304811692600160a81b81049091169163ffffffff600160b01b8304811692600160d01b9004169086565b6001600160a01b038116600090815261016e602052604081205460ff16612b0a57506000612a78565b61113682614659565b6101666020908152600092835260408084209091529082529020805460019091015463ffffffff80831692600160201b8104909116916001600160601b03600160401b8304811692600160a01b9004169085565b61016d6020526000908152604090205481565b61016b6020908152600092835260408084209091529082529020805460019091015463ffffffff1682565b600054610100900460ff1680612bbe5750612bbe6146fb565b80612bcc575060005460ff16155b612c075760405162461bcd60e51b815260040180806020018281038252602e815260200180615bb0602e913960400191505060405180910390fd5b600054610100900460ff16158015612c32576000805460ff1961ff0019909116610100171660011790555b612c3a614701565b612c426147b2565b61016180546001600160a01b038089166001600160a01b03199283161790925561016280549288169290911691909117905560408051808201909152601d81527f564c504d696e696e673a20746f6f20626967207374617274426c6f636b0000006020820152612cb3908490614396565b61016260186101000a81548163ffffffff021916908363ffffffff160217905550612d13826040518060400160405280601e81526020017f564c504d696e696e673a20746f6f20626967207665737420706572696f640000815250614396565b61016260146101000a81548163ffffffff021916908363ffffffff160217905550612d3d84612340565b8015612d4f576000805461ff00191690555b505050505050565b612d5f61412d565b6065546001600160a01b03908116911614612daf576040805162461bcd60e51b81526020600482018190526024820152600080516020615b90833981519152604482015290519081900360640190fd5b612dd181604051806060016040528060228152602001615b2c602291396145d3565b61016160146101000a8154816001600160601b0302191690836001600160601b0316021790555050565b61016f6020526000908152604090205481565b610161546001600160a01b031681565b6101696020526000908152604090205481565b610163546001600160601b031681565b612e4961412d565b6065546001600160a01b03908116911614612e99576040805162461bcd60e51b81526020600482018190526024820152600080516020615b90833981519152604482015290519081900360640190fd5b6001600160a01b038116612ede5760405162461bcd60e51b8152600401808060200182810382526026815260200180615adb6026913960400191505060405180910390fd5b6065546040516001600160a01b038084169216907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a3606580546001600160a01b0319166001600160a01b0392909216919091179055565b6101656020526000908152604090205481565b610164548110611670576040805162461bcd60e51b815260206004820152601a60248201527f564c504d696e696e673a20696e76616c696420706f6f6c206964000000000000604482015290519081900360640190fd5b32600090815261016960205260409020544311612ff9576040805162461bcd60e51b815260206004820152600e60248201526d29a0a6a2afaa2c2fa7a924a3a4a760911b604482015290519081900360640190fd5b32600081815261016960205260409020439055331461307c5733600090815261016960205260409020544311613068576040805162461bcd60e51b815260206004820152600f60248201526e29a0a6a2afa6a9a3afa9a2a72222a960891b604482015290519081900360640190fd5b336000908152610169602052604090204390555b565b6130866159eb565b506040805160c08101825283546001600160a01b038116825260ff600160a01b8204811615156020840152600160a81b8204169282019290925263ffffffff600160b01b830481166060830152600160d01b90920490911660808201819052600184015460a0830181905260006130fc84613d41565b8554909150156131f75761310e615a20565b506040805160a0810182528654815260018701546020820152600287015463ffffffff16918101829052600387015460608201819052600488015460808301819052875192939290919061316e90613167908690613db9565b8690613672565b63ffffffff881660808a015294506131896131678986613e0b565b945081846080015111156131a257608084015160048a01555b80846060015111156131b957606084015160038a01555b8263ffffffff16846040015163ffffffff1611156131f257604084015160028a01805463ffffffff191663ffffffff9092169190911790555b505050505b818460a00151111561320e5760a084015160018701555b8263ffffffff16846080015163ffffffff16111561324b576080840151865463ffffffff909116600160d01b0263ffffffff60d01b199091161786555b8015612d4f576132e2613293826040518060400160405280601a81526020017f564c504d696e696e673a3a5f646f506f6f6c5570646174653a310000000000008152506145d3565b60408051808201909152601a81527f564c504d696e696e673a3a5f646f506f6f6c5570646174653a32000000000000602082015261016154600160a01b90046001600160601b03169190614860565b61016160146101000a8154816001600160601b0302191690836001600160601b03160217905550505050505050565b613319615a55565b506040805160a081018252855463ffffffff8082168352600160201b82041660208301526001600160601b03600160401b8204811693830193909352600160a01b9004909116606082015260018501546080820152613376615a83565b506040805180820182528454815260018086015463ffffffff908116602080850191909152858101518651865160c0810188528b546001600160a01b038116825260ff600160a01b82048116151583870152600160a81b820416828a0152600160b01b81048616606080840191909152600160d01b90910486166080808401919091528d88015460a0808501919091528a519081018b528c548152978c01549588019590955260028b0154909516978601979097526003890154938501939093526004880154918401919091529293909160009182916134599188918890613e51565b9150915081600014158061346c57508015155b156134a65760408601518a546001600160601b03909116600160401b0273ffffffffffffffffffffffff000000000000000019909116178a555b801561359f5761016154600160a01b90046001600160601b03168111156134dd575061016154600160a01b90046001600160601b03165b61356e61351f826040518060400160405280601981526020017f564c504d696e696e673a3a5f76657374557365724376703a31000000000000008152506145d3565b60408051808201909152601981527f564c504d696e696e673a3a5f76657374557365724376703a3200000000000000602082015261016154600160a01b90046001600160601b031691906148ca565b61016160146101000a8154816001600160601b0302191690836001600160601b0316021790555061359f3382614937565b8363ffffffff16866020015163ffffffff1611156135dd5760208601518a5463ffffffff909116600160201b0267ffffffff0000000019909116178a555b855163ffffffff808516911611156136065785518a5463ffffffff191663ffffffff909116178a555b50505050505050505050565b604080516001600160a01b0380861660248301528416604482015260648082018490528251808303909101815260849091019091526020810180516001600160e01b03166323b872dd60e01b17905261366c908590614957565b50505050565b600082820183811015611c4b576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60006136dc858560a00151614b0f565b90508160200151600014806136f057508151155b806136fa57508251155b156137045761177f565b61177c613715868460600151614b0f565b61373a61372a86600001518660800151614b0f565b6001600160601b03851690614591565b6001600160601b031690614591565b6101645460008080805b84811015613c11576000818152610166602090815260408083206001600160a01b038a16845290915290205461379c906001600160601b0386811691600160401b900416614591565b9350600061016482815481106137ae57fe5b60009182526020808320600290920290910180546001600160a01b03908116808552610168909352604084205491945016806138b85761016154604080516370a0823160e01b81526001600160a01b038581166004830152915161389c9392909216916370a0823191602480820192602092909190829003018186803b15801561383757600080fd5b505afa15801561384b573d6000803e3d6000fd5b505050506040513d602081101561386157600080fd5b505160408051808201909152601f81527f564c504d696e696e673a3a5f646f436865636b706f696e74566f7465733a310060208201526145d3565b92506138b16001600160601b03871684614591565b9550613a8c565b6000816001600160a01b03166318160ddd6040518163ffffffff1660e01b815260040160206040518083038186803b1580156138f357600080fd5b505afa158015613907573d6000803e3d6000fd5b505050506040513d602081101561391d57600080fd5b5051604080516370a0823160e01b81526001600160a01b0386811660048301529151929350600092918516916370a0823191602480820192602092909190829003018186803b15801561396f57600080fd5b505afa158015613983573d6000803e3d6000fd5b505050506040513d602081101561399957600080fd5b5051905060006139b283611fac8464e8d4a51000614481565b61016154604080516370a0823160e01b81526001600160a01b038881166004830152915193945060009391909216916370a08231916024808301926020929190829003018186803b158015613a0657600080fd5b505afa158015613a1a573d6000803e3d6000fd5b505050506040513d6020811015613a3057600080fd5b50519050613a85613a4a64e8d4a51000611fac8486614481565b6040518060400160405280601f81526020017f564c504d696e696e673a3a5f646f436865636b706f696e74566f7465733a31008152506145d3565b9650505050505b8354600160a01b900460ff16613aa55750505050613c09565b8354604080516318160ddd60e01b815290516000926001600160a01b0316916318160ddd916004808301926020929190829003018186803b158015613ae957600080fd5b505afa158015613afd573d6000803e3d6000fd5b505050506040513d6020811015613b1357600080fd5b810190808051906020019092919050505090506000610166600088815260200190815260200160002060008d6001600160a01b03166001600160a01b0316815260200190815260200160002060010154905080600014158015613b7557508115155b15613c02576000613b9883611fac6001600160601b03891664e8d4a51000614481565b90506000613baf64e8d4a51000611fac8585614481565b9050613bbb8b82613672565b9a50888e6001600160a01b03167f84f3863b4a309d20b83ad6a41ab2860bf0603f2e4cdab881907e7a847276a661836040518082815260200191505060405180910390a350505b5050505050505b600101613753565b506000821580613c2857506001600160601b038216155b613c8b57613c86613c4b6001600160601b038416611fac8664e8d4a51000614481565b6040518060400160405280601f81526020017f564c504d696e696e673a3a5f646f436865636b706f696e74566f7465733a32008152506145d3565b613c8e565b60005b604080516001600160601b038516815290519192507fa51ed239c57bb58dd90b5196b2a3a35e8254954f924d0a8eed8e68460d90254f919081900360200190a1604080516001600160601b0380871682528316602082015281516001600160a01b038916927ff55c0f893af4049399318f4399e95624341f7d36e6958902eb15a73ab771c14f928290030190a2613d2e86613d298684614b62565b614b86565b612d4f613d3c836000614b62565b614c60565b608081015160a0820151825161016754606085015161016354600095613da19563ffffffff91821695909490938493613d9c93611fac92811691613d969164e8d4a51000916001600160601b03169061448116565b90614481565b614c7a565b63ffffffff16608085015260a0909301929092525090565b6000613df0836040015163ffffffff16846080015161016160009054906101000a90046001600160a01b0316858760200151614c7a565b63ffffffff1660408601526080909401939093525090919050565b6000613e34836080015163ffffffff168360600151856000015186600001518660000151614c7a565b63ffffffff16608090950194909452606090920192909252919050565b83516000908190613e60614350565b63ffffffff90811680895290821610613e80576000809250925050614124565b8651819003613e918888888861451c565b6001600160601b0316935060008415613ed55761016254613ed09063ffffffff600160a01b90910481168401811690611fac9088908681169061448116565b613ed8565b60005b9050600089604001516001600160601b03169050896020015163ffffffff168a6000015163ffffffff161015613f12578951849003613f24565b61016254600160a01b900463ffffffff165b925060008115613f7f576101625463ffffffff600160a01b90910481169085161015613f7857613f73858c602001510363ffffffff16611fac8663ffffffff168561448190919063ffffffff16565b613f7a565b815b613f82565b60005b9050613f8e8184613672565b9550613ff8613fbd87613fb78a8f604001516001600160601b031661367290919063ffffffff16565b9061443f565b6040518060400160405280601b81526020017f564c504d696e696e673a3a636f6d70757465437670566573743a3100000000008152506145d3565b6001600160601b031660408c01526000821561401d57614018838361443f565b614020565b60005b90506000881561403957614034898661443f565b61403c565b60005b9050600061404a8383613672565b90506000831580614059575081155b15614075575061016254600160a01b900463ffffffff166140cb565b8e600001518f602001510397506140c882611fac6140b561016260149054906101000a900463ffffffff1663ffffffff168761448190919063ffffffff16565b611d418863ffffffff808f169061448116565b90505b6101625463ffffffff808316600160a01b90920416116140fb5761016254600160a01b900463ffffffff166140fd565b805b8f60000151018f6020019063ffffffff16908163ffffffff16815250505050505050505050505b94509492505050565b3390565b6001600160a01b038216600090815261012d60205260408120819061415f9063ffffffff80861690614d9916565b909590945092505050565b6001600160601b03606082901c811692911690565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b1790526141d1908490614957565b505050565b6000611c4b83836040518060400160405280602081526020017f536166654d61746839363a207375627472616374696f6e206f766572666c6f778152506148ca565b6001600160a01b03808316600081815261012d60205260408082208054868616600160401b81810268010000000000000000600160e01b03198416179093559251919004909416939092849290917f3134e8a2e6d97e929a7e54011ea5485d7d196dd5f0ba4d4ef95803e8e3fc257f9190a46141d1838284614dd1565b6001600160a01b038416600090815261012d60205260408120819081906142c6908763ffffffff80891690614f1a16565b91509150816001600160c01b0316600014156142e75760009250505061177f565b30600090815261012d6020526040812061430b908863ffffffff80891690614f1a16565b5030600090815261012d60205260408120919250906143359063ffffffff808616908490614f1a16565b50905061434384838361507e565b9998505050505050505050565b6000614391436040518060400160405280601e81526020017f564c504d696e696e673a3a5f63757272426c6f636b3a6f766572666c6f770000815250614396565b905090565b600081600160201b84106144285760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156143ed5781810151838201526020016143d5565b50505050905090810190601f16801561441a5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b509192915050565b6000611c4b8383600080614295565b6000611c4b83836040518060400160405280601e81526020017f536166654d6174683a207375627472616374696f6e206f766572666c6f7700008152506151a8565b60008261449057506000611136565b8282028284828161449d57fe5b0414611c4b5760405162461bcd60e51b8152600401808060200182810382526021815260200180615b6f6021913960400191505060405180910390fd5b6000611c4b83836040518060400160405280601a81526020017f536166654d6174683a206469766973696f6e206279207a65726f0000000000008152506151fa565b60008460800151600014156145335750600061177f565b61177c85606001516040518060400160405280601781526020017f564c504d696e696e673a3a636f6d707574654376703a3200000000000000000081525061458188608001518888886136cc565b6001600160601b031691906148ca565b6000611c4b83836040518060400160405280601d81526020017f536166654d61746839363a206164646974696f6e206f766572666c6f77000000815250614860565b600081600160601b84106144285760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156143ed5781810151838201526020016143d5565b60008060006146368461525f565b855490915063ffffffff1661464c8682846152be565b9097909650945050505050565b6001600160a01b038116600090815261012d602052604081208190819061467f90615456565b91509150816001600160c01b0316600014156146a057600092505050612a78565b30600090815261012d602052604081206146b990615456565b5030600090815261012d60205260408120919250906146e39063ffffffff808616908490614f1a16565b5090506146f184838361507e565b9695505050505050565b303b1590565b600054610100900460ff168061471a575061471a6146fb565b80614728575060005460ff16155b6147635760405162461bcd60e51b815260040180806020018281038252602e815260200180615bb0602e913960400191505060405180910390fd5b600054610100900460ff1615801561478e576000805460ff1961ff0019909116610100171660011790555b6147966154f1565b61479e615591565b8015611670576000805461ff001916905550565b600054610100900460ff16806147cb57506147cb6146fb565b806147d9575060005460ff16155b6148145760405162461bcd60e51b815260040180806020018281038252602e815260200180615bb0602e913960400191505060405180910390fd5b600054610100900460ff1615801561483f576000805460ff1961ff0019909116610100171660011790555b6097805460ff191660011790558015611670576000805461ff001916905550565b6000838301826001600160601b0380871690831610156148c15760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156143ed5781810151838201526020016143d5565b50949350505050565b6000836001600160601b0316836001600160601b03161115829061492f5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156143ed5781810151838201526020016143d5565b505050900390565b6101615461016254611743916001600160a01b0390811691168484613612565b614969826001600160a01b031661568a565b6149ba576040805162461bcd60e51b815260206004820152601f60248201527f5361666545524332303a2063616c6c20746f206e6f6e2d636f6e747261637400604482015290519081900360640190fd5b60006060836001600160a01b0316836040518082805190602001908083835b602083106149f85780518252601f1990920191602091820191016149d9565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114614a5a576040519150601f19603f3d011682016040523d82523d6000602084013e614a5f565b606091505b509150915081614ab6576040805162461bcd60e51b815260206004820181905260248201527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564604482015290519081900360640190fd5b80511561366c57808060200190516020811015614ad257600080fd5b505161366c5760405162461bcd60e51b815260040180806020018281038252602a815260200180615bde602a913960400191505060405180910390fd5b6000611c4b614b2764e8d4a51000611fac8686614481565b6040518060400160405280601981526020017f564c504d696e696e673a3a5f636f6d7075746543767041646a000000000000008152506145d3565b6001600160601b031660609190911b6bffffffffffffffffffffffff60601b161790565b6001600160a01b03808316600090815261012d6020526040812080549092600160401b90910416908115614bd2576001600160a01b038216600090815261012d60205260409020614bd4565b825b90506000614be182615456565b506001600160a01b038716600090815261012e6020526040902054909150614c2090614c1990839088906001600160c01b03166156c3565b8390615721565b505050506001600160a01b0392909216600090815261012e6020526040902080546001600160c01b0319166001600160c01b039290921691909117905550565b30600090815261012d602052604090206117439082615721565b60008481614c86614350565b9050878163ffffffff161115614d8e576101615463ffffffff8216899003906000906001600160a01b0389811691161415614cdb57506001600160a01b038616600090815261016f6020526040902054614d50565b604080516370a0823160e01b815230600482015290516001600160a01b038a16916370a08231916024808301926020929190829003018186803b158015614d2157600080fd5b505afa158015614d35573d6000803e3d6000fd5b505050506040513d6020811015614d4b57600080fd5b505190505b8015614d8b57614d6964e8d4a51000611fac8489614481565b9450614d88614d8182611fac8864e8d4a51000614481565b8590613672565b93505b50505b955095509592505050565b600080821580614daf5750835463ffffffff1683115b614dc257614dbd848461589c565b614dc6565b6000805b915091509250929050565b6000806001600160a01b038416614e0b5750506001600160a01b03808416600090815261012d602052604080822092841682529020614e67565b6001600160a01b038316614e425750506001600160a01b03808316600090815261012d602052604080822092861682529020614e67565b50506001600160a01b03808316600090815261012d6020526040808220928416825290205b6001600160a01b038516600090815261012e60205260408120546001600160c01b031690614e9484615456565b5090506000614ea5826000856156c3565b9050806001600160c01b0316826001600160c01b031614614ecc57614eca8582615721565b505b6000614ed785615456565b5090506000614ee8828660006156c3565b9050806001600160c01b0316826001600160c01b03161461360657614f0d8682615721565b5050505050505050505050565b6000806000614f288561525f565b9050614f32615a9a565b5060408051606081018252875463ffffffff8082168352600160201b8204166020830152600160401b90046001600160a01b031691810191909152614f75615a83565b851561503f57815163ffffffff16861115614fd7576040805162461bcd60e51b815260206004820152601f60248201527f4368506f696e74733a20696e76616c696420636865636b706f696e7420696400604482015290519081900360640190fd5b5063ffffffff8581166000908152600189016020908152604091829020825180840190935254808416808452600160201b9091046001600160c01b03169183019190915290918791908516141561503d5750602081015190519094509250615076915050565b505b6000806150518a8560000151876152be565b63ffffffff918216600090815260018d01602052604090205490985016955050505050505b935093915050565b600080600061508c8661416a565b91509150600061509b8661416a565b50905060006150a98661416a565b5090506001600160601b0383166150c25783945061519d565b60006150e364e8d4a51000611fac6001600160601b03878116908716614481565b9050816001600160601b0316836001600160601b0316146151475760006151206001600160601b0380851690611fac90871664e8d4a51000614481565b905064e8d4a510008111156151455761514281611fac8464e8d4a51000614481565b91505b505b615199615189826040518060400160405280601881526020017f564c504d696e696e673a3a5f636f6d70757465566f74657300000000000000008152506145d3565b6001600160601b03871690614591565b9550505b505050509392505050565b6000818484111561492f5760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156143ed5781810151838201526020016143d5565b600081836152495760405162461bcd60e51b81526020600482018181528351602484015283519092839260449091019190850190808383600083156143ed5781810151838201526020016143d5565b50600083858161525557fe5b0495945050505050565b60004382106152b5576040805162461bcd60e51b815260206004820152601d60248201527f4368506f696e74733a20626c6f636b206e6f7420796574206d696e6564000000604482015290519081900360640190fd5b611136826158d0565b6000806152c9615a83565b63ffffffff85166152e1576000809250925050615076565b5063ffffffff8481166000908152600187016020908152604091829020825180840190935254808416808452600160201b9091046001600160c01b031691830191909152909185161061533c57602001518492509050615076565b60016000818152908701602052604090205463ffffffff8086169116111561536b576000809250925050615076565b6001855b8163ffffffff168163ffffffff16111561541e576000600263ffffffff8484031604820363ffffffff818116600090815260018c016020908152604091829020825180840190935254808416808452600160201b9091046001600160c01b031691830191909152909650919250881614156153f7578084602001519550955050505050615076565b835163ffffffff8089169116101561541157809250615418565b6001810391505b5061536f565b5063ffffffff811660009081526001880160205260409020549093506001600160c01b03600160201b90910416915050935093915050565b600080615461615a9a565b5060408051606081018252845463ffffffff808216808452600160201b83049091166020840152600160401b9091046001600160a01b03169282019290925290156154e357805163ffffffff908116600090815260018601602052604080822054845184168352912054600160201b9091046001600160c01b031691166154e7565b6000805b9250925050915091565b600054610100900460ff168061550a575061550a6146fb565b80615518575060005460ff16155b6155535760405162461bcd60e51b815260040180806020018281038252602e815260200180615bb0602e913960400191505060405180910390fd5b600054610100900460ff1615801561479e576000805460ff1961ff0019909116610100171660011790558015611670576000805461ff001916905550565b600054610100900460ff16806155aa57506155aa6146fb565b806155b8575060005460ff16155b6155f35760405162461bcd60e51b815260040180806020018281038252602e815260200180615bb0602e913960400191505060405180910390fd5b600054610100900460ff1615801561561e576000805460ff1961ff0019909116610100171660011790555b600061562861412d565b606580546001600160a01b0319166001600160a01b038316908117909155604051919250906000907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508015611670576000805461ff001916905550565b6000813f7fc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a47081811480159061177f575050151592915050565b60008060006156d18661416a565b915091506000806156e18761416a565b915091506000806156f18861416a565b9150915061571361570387868561592e565b61570e87868561592e565b614b62565b9a9950505050505050505050565b60008061572d436158d0565b9050615737615a9a565b5060408051606081018252855463ffffffff808216808452600160201b83049091166020840152600160401b9091046001600160a01b031692820192909252906000906157855760006157af565b815163ffffffff166000908152600187016020526040902054600160201b90046001600160c01b03165b90506000816001600160c01b0316866001600160c01b0316141590508363ffffffff16836020015163ffffffff161461581a57508151600190810163ffffffff908116808552885463ffffffff19161767ffffffff000000001916600160201b918616919091021787555b80156158915760408051808201825263ffffffff86811682526001600160c01b03898116602080850191825288518416600090815260018e019091529490942092518354945163ffffffff19909516921691909117640100000000600160e01b031916600160201b93909116929092029190911790555b505051949350505050565b63ffffffff908116600090815260019290920160205260409091205490811691600160201b9091046001600160c01b031690565b6000600160201b821061592a576040805162461bcd60e51b815260206004820152601b60248201527f4368506f696e74733a20626c6f636b4e756d203e3d20322a2a33320000000000604482015290519081900360640190fd5b5090565b6000816001600160601b0316836001600160601b03161415615951575082611c4b565b816001600160601b0316836001600160601b03161115615998576159916159816001600160601b038516846141d6565b6001600160601b03861690614591565b9050611c4b565b60006159ad6001600160601b038416856141d6565b9050806001600160601b0316856001600160601b0316116159cf5760006159e2565b6159e26001600160601b038616826141d6565b95945050505050565b6040805160c081018252600080825260208201819052918101829052606081018290526080810182905260a081019190915290565b6040518060a001604052806000815260200160008152602001600063ffffffff16815260200160008152602001600081525090565b6040805160a08101825260008082526020820181905291810182905260608101829052608081019190915290565b604080518082019091526000808252602082015290565b60408051606081018252600080825260208201819052918101919091529056fe5265656e7472616e637947756172643a207265656e7472616e742063616c6c004f776e61626c653a206e6577206f776e657220697320746865207a65726f2061646472657373564c504d696e696e673a20746f6f206269672063767056657374696e67506572696f64496e426c6f636b73564c504d696e696e673a20746f6f20626967205f63767056657374696e67506f6f6c564c504d696e696e673a20616d6f756e7420657863656564732062616c616e6365536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572436f6e747261637420696e7374616e63652068617320616c7265616479206265656e20696e697469616c697a65645361666545524332303a204552433230206f7065726174696f6e20646964206e6f74207375636365656464656c65676174653a2063616e27742064656c656761746520746f2074686520636f6e74726163742061646472657373a2646970667358221220f925ce6626ee12fac5f7de76df77b215abc05e307b171a89cecf9f22324d0f9f64736f6c634300060c0033
Verified Source Code Partial Match
Compiler: v0.6.12+commit.27d51765
EVM: istanbul
Optimization: Yes (200 runs)
VestedLPMining.sol 2101 lines
/*
https://powerpool.finance/
wrrrw r wrr
ppwr rrr wppr0 prwwwrp prwwwrp wr0
rr 0rrrwrrprpwp0 pp pr prrrr0 pp 0r prrrr0 0rwrrr pp pr prrrr0 prrrr0 r0
rrp pr wr00rrp prwww0 pp wr pp w00r prwwwpr 0rw prwww0 pp wr pp wr r0
r0rprprwrrrp pr0 pp wr pr pp rwwr wr 0r pp wr pr wr pr r0
prwr wrr0wpwr 00 www0 0w0ww www0 0w 00 www0 www0 0www0
wrr ww0rrrr
*/
// SPDX-License-Identifier: MIT
// File @openzeppelin/contracts-ethereum-package/contracts/[email protected]
pragma solidity >=0.4.24 <0.7.0;
/**
* @title Initializable
*
* @dev Helper contract to support initializer functions. To use it, replace
* the constructor with a function that has the `initializer` modifier.
* WARNING: Unlike constructors, initializer functions must be manually
* invoked. This applies both to deploying an Initializable contract, as well
* as extending an Initializable contract via inheritance.
* WARNING: When used with inheritance, manual care must be taken to not invoke
* a parent initializer twice, or ensure that all initializers are idempotent,
* because this is not dealt with automatically as with constructors.
*/
contract Initializable {
/**
* @dev Indicates that the contract has been initialized.
*/
bool private initialized;
/**
* @dev Indicates that the contract is in the process of being initialized.
*/
bool private initializing;
/**
* @dev Modifier to use in the initializer function of a contract.
*/
modifier initializer() {
require(initializing || isConstructor() || !initialized, "Contract instance has already been initialized");
bool isTopLevelCall = !initializing;
if (isTopLevelCall) {
initializing = true;
initialized = true;
}
_;
if (isTopLevelCall) {
initializing = false;
}
}
/// @dev Returns true if and only if the function is running in the constructor
function isConstructor() private view returns (bool) {
// extcodesize checks the size of the code stored in an address, and
// address returns the current address. Since the code is still not
// deployed when running a constructor, any checks on its code size will
// yield zero, making it an effective way to detect if a contract is
// under construction or not.
address self = address(this);
uint256 cs;
assembly { cs := extcodesize(self) }
return cs == 0;
}
// Reserved storage space to allow for layout changes in the future.
uint256[50] private ______gap;
}
// File @openzeppelin/contracts-ethereum-package/contracts/GSN/[email protected]
pragma solidity ^0.6.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 GSN 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.
*/
contract ContextUpgradeSafe is Initializable {
// Empty internal constructor, to prevent people from mistakenly deploying
// an instance of this contract, which should be used via inheritance.
function __Context_init() internal initializer {
__Context_init_unchained();
}
function __Context_init_unchained() internal initializer {
}
function _msgSender() internal view virtual returns (address payable) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes memory) {
this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
return msg.data;
}
uint256[50] private __gap;
}
// File @openzeppelin/contracts-ethereum-package/contracts/access/[email protected]
pragma solidity ^0.6.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.
*/
contract OwnableUpgradeSafe is Initializable, ContextUpgradeSafe {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
/**
* @dev Initializes the contract setting the deployer as the initial owner.
*/
function __Ownable_init() internal initializer {
__Context_init_unchained();
__Ownable_init_unchained();
}
function __Ownable_init_unchained() internal initializer {
address msgSender = _msgSender();
_owner = msgSender;
emit OwnershipTransferred(address(0), msgSender);
}
/**
* @dev Returns the address of the current owner.
*/
function owner() public view returns (address) {
return _owner;
}
/**
* @dev Throws if called by any account other than the owner.
*/
modifier onlyOwner() {
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 {
emit OwnershipTransferred(_owner, address(0));
_owner = 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");
emit OwnershipTransferred(_owner, newOwner);
_owner = newOwner;
}
uint256[49] private __gap;
}
// File @openzeppelin/contracts-ethereum-package/contracts/math/[email protected]
pragma solidity ^0.6.0;
/**
* @dev Wrappers over Solidity's arithmetic operations with added overflow
* checks.
*
* Arithmetic operations in Solidity wrap on overflow. This can easily result
* in bugs, because programmers usually assume that an overflow raises an
* error, which is the standard behavior in high level programming languages.
* `SafeMath` restores this intuition by reverting the transaction when an
* operation overflows.
*
* Using this library instead of the unchecked operations eliminates an entire
* class of bugs, so it's recommended to use it always.
*/
library SafeMath {
/**
* @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) {
uint256 c = a + b;
require(c >= a, "SafeMath: addition overflow");
return c;
}
/**
* @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 sub(a, b, "SafeMath: subtraction overflow");
}
/**
* @dev Returns the subtraction of two unsigned integers, reverting with custom message on
* overflow (when the result is negative).
*
* Counterpart to Solidity's `-` operator.
*
* Requirements:
* - Subtraction cannot overflow.
*/
function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
require(b <= a, errorMessage);
uint256 c = a - b;
return c;
}
/**
* @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) {
// 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 0;
}
uint256 c = a * b;
require(c / a == b, "SafeMath: multiplication overflow");
return c;
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts 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) internal pure returns (uint256) {
return div(a, b, "SafeMath: division by zero");
}
/**
* @dev Returns the integer division of two unsigned integers. Reverts 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) {
// Solidity only automatically asserts when dividing by 0
require(b > 0, errorMessage);
uint256 c = a / b;
// assert(a == b * c + a % b); // There is no case in which this doesn't hold
return c;
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts 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 mod(a, b, "SafeMath: modulo by zero");
}
/**
* @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
* Reverts with custom message 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, string memory errorMessage) internal pure returns (uint256) {
require(b != 0, errorMessage);
return a % b;
}
}
// File @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/[email protected]
pragma solidity ^0.6.0;
/**
* @dev Interface of the ERC20 standard as defined in the EIP.
*/
interface IERC20 {
/**
* @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 `recipient`.
*
* Returns a boolean value indicating whether the operation succeeded.
*
* Emits a {Transfer} event.
*/
function transfer(address recipient, 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 `sender` to `recipient` 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 sender, address recipient, uint256 amount) external returns (bool);
/**
* @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);
}
// File @openzeppelin/contracts-ethereum-package/contracts/utils/[email protected]
pragma solidity ^0.6.2;
/**
* @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
* ====
*/
function isContract(address account) internal view returns (bool) {
// According to EIP-1052, 0x0 is the value returned for not-yet created accounts
// and 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470 is returned
// for accounts without code, i.e. `keccak256('')`
bytes32 codehash;
bytes32 accountHash = 0xc5d2460186f7233c927e7db2dcc703c0e500b653ca82273b7bfad8045d85a470;
// solhint-disable-next-line no-inline-assembly
assembly { codehash := extcodehash(account) }
return (codehash != accountHash && codehash != 0x0);
}
/**
* @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");
// solhint-disable-next-line avoid-low-level-calls, avoid-call-value
(bool success, ) = recipient.call{ value: amount }("");
require(success, "Address: unable to send value, recipient may have reverted");
}
}
// File @openzeppelin/contracts-ethereum-package/contracts/token/ERC20/[email protected]
pragma solidity ^0.6.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 ERC20;` statement to your contract,
* which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
*/
library SafeERC20 {
using SafeMath for uint256;
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));
}
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'
// solhint-disable-next-line max-line-length
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).add(value);
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
_callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
}
/**
* @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.
// A Solidity high level call has three parts:
// 1. The target address is checked to verify it contains contract code
// 2. The call itself is made, and success asserted
// 3. The return value is decoded, which in turn checks the size of the returned data.
// solhint-disable-next-line max-line-length
require(address(token).isContract(), "SafeERC20: call to non-contract");
// solhint-disable-next-line avoid-low-level-calls
(bool success, bytes memory returndata) = address(token).call(data);
require(success, "SafeERC20: low-level call failed");
if (returndata.length > 0) { // Return data is optional
// solhint-disable-next-line max-line-length
require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
}
}
}
// File @openzeppelin/contracts-ethereum-package/contracts/utils/[email protected]
pragma solidity ^0.6.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].
*/
contract ReentrancyGuardUpgradeSafe is Initializable {
bool private _notEntered;
function __ReentrancyGuard_init() internal initializer {
__ReentrancyGuard_init_unchained();
}
function __ReentrancyGuard_init_unchained() internal initializer {
// Storing an initial 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 percetange 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.
_notEntered = true;
}
/**
* @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 make it call a
* `private` function that does the actual work.
*/
modifier nonReentrant() {
// On the first call to nonReentrant, _notEntered will be true
require(_notEntered, "ReentrancyGuard: reentrant call");
// Any calls to nonReentrant after this point will fail
_notEntered = false;
_;
// By storing the original value once again, a refund is triggered (see
// https://eips.ethereum.org/EIPS/eip-2200)
_notEntered = true;
}
uint256[49] private __gap;
}
// File contracts/interfaces/ILpTokenMigrator.sol
pragma solidity 0.6.12;
// note "contracts-ethereum-package" (but not "contracts") version of the package
interface ILpTokenMigrator {
// Perform LP token migration from legacy UniswapV2 to PowerSwap.
// Take the current LP token address and return the new LP token address.
// Migrator should have full access to the caller's LP token.
// Return the new LP token address.
//
// XXX Migrator must have allowance access to UniswapV2 LP tokens.
// PowerSwap must mint EXACTLY the same amount of PowerSwap LP tokens or
// else something bad will happen. Traditional UniswapV2 does not
// do that so be careful!
function migrate(IERC20 token, uint8 poolType) external returns (IERC20);
}
// File contracts/interfaces/IVestedLPMining.sol
pragma solidity 0.6.12;
/**
* @notice
*/
interface IVestedLPMining {
/**
* @notice Initializes the storage of the contract
* @dev "constructor" to be called on a new proxy deployment
* @dev Sets the contract `owner` account to the deploying account
*/
function initialize(
IERC20 _cvp,
address _reservoir,
uint256 _cvpPerBlock,
uint256 _startBlock,
uint256 _cvpVestingPeriodInBlocks
) external;
function poolLength() external view returns (uint256);
/// @notice Add a new pool (only the owner may call)
function add(
uint256 _allocPoint,
IERC20 _lpToken,
uint8 _poolType,
bool _votesEnabled,
uint256 _lpBoostRate,
uint256 _cvpBoostRate,
uint256 _lpBoostMinRatio,
uint256 _lpBoostMaxRatio
) external;
/// @notice Update parameters of the given pool (only the owner may call)
function set(
uint256 _pid,
uint256 _allocPoint,
uint8 _poolType,
bool _votesEnabled,
uint256 _lpBoostRate,
uint256 _cvpBoostRate,
uint256 _lpBoostMinRatio,
uint256 _lpBoostMaxRatio
) external;
/// @notice Set the migrator contract (only the owner may call)
function setMigrator(ILpTokenMigrator _migrator) external;
/// @notice Set CVP reward per block (only the owner may call)
/// @dev Consider updating pool before calling this function
function setCvpPerBlock(uint256 _cvpPerBlock) external;
/// @notice Set CVP vesting period in blocks (only the owner may call)
function setCvpVestingPeriodInBlocks(uint256 _cvpVestingPeriodInBlocks) external;
function setCvpPoolByMetaPool(address _metaPool, address _cvpPool) external;
/// @notice Return the amount of pending CVPs entitled to the given user of the pool
function pendingCvp(uint256 _pid, address _user) external view returns (uint256);
/// @notice Return the amount of CVP tokens which may be vested to a user of a pool in the current block
function vestableCvp(uint256 _pid, address user) external view returns (uint256);
/// @notice Return `true` if the LP Token is added to created pools
function isLpTokenAdded(IERC20 _lpToken) external view returns (bool);
/// @notice Update reward computation params for all pools
/// @dev Be careful of gas spending
function massUpdatePools() external;
/// @notice Update CVP tokens allocation for the given pool
function updatePool(uint256 _pid) external;
/// @notice Deposit the given amount of LP tokens to the given pool
function deposit(
uint256 _pid,
uint256 _amount,
uint256 _boostAmount
) external;
/// @notice Withdraw the given amount of LP tokens from the given pool
function withdraw(
uint256 _pid,
uint256 _amount,
uint256 _boostAmount
) external;
/// @notice Withdraw LP tokens without caring about pending CVP tokens. EMERGENCY ONLY.
function emergencyWithdraw(uint256 _pid) external;
/// @notice Write votes of the given user at the current block
function checkpointVotes(address _user) external;
/// @notice Get CVP amount and the share of CVPs in LP pools for the given account and the checkpoint
function getCheckpoint(address account, uint32 checkpointId)
external
view
returns (
uint32 fromBlock,
uint96 cvpAmount,
uint96 pooledCvpShare
);
event AddLpToken(address indexed lpToken, uint256 indexed pid, uint256 allocPoint);
event SetLpToken(address indexed lpToken, uint256 indexed pid, uint256 allocPoint);
event SetMigrator(address indexed migrator);
event SetCvpPerBlock(uint256 cvpPerBlock);
event SetCvpVestingPeriodInBlocks(uint256 cvpVestingPeriodInBlocks);
event SetCvpPoolByMetaPool(address indexed metaPool, address indexed cvpPool);
event MigrateLpToken(address indexed oldLpToken, address indexed newLpToken, uint256 indexed pid);
event Deposit(address indexed user, uint256 indexed pid, uint256 amount, uint256 boostAmount);
event Withdraw(address indexed user, uint256 indexed pid, uint256 amount, uint256 boostAmount);
event EmergencyWithdraw(address indexed user, uint256 indexed pid, uint256 amount, uint256 boostAmount);
event CheckpointTotalLpVotes(uint256 lpVotes);
event CheckpointUserLpVotes(address indexed user, uint256 indexed pid, uint256 lpVotes);
event CheckpointUserVotes(address indexed user, uint256 pendedVotes, uint256 lpVotesShare);
}
// File contracts/lib/ReservedSlots.sol
pragma solidity 0.6.12;
/// @dev Slots reserved for possible storage layout changes (it neither spends gas nor adds extra bytecode)
contract ReservedSlots {
uint256[100] private __gap;
}
// File contracts/lib/SafeMath96.sol
pragma solidity 0.6.12;
library SafeMath96 {
function add(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
uint96 c = a + b;
require(c >= a, errorMessage);
return c;
}
function add(uint96 a, uint96 b) internal pure returns (uint96) {
return add(a, b, "SafeMath96: addition overflow");
}
function sub(uint96 a, uint96 b, string memory errorMessage) internal pure returns (uint96) {
require(b <= a, errorMessage);
return a - b;
}
function sub(uint96 a, uint96 b) internal pure returns (uint96) {
return sub(a, b, "SafeMath96: subtraction overflow");
}
function average(uint96 a, uint96 b) internal pure returns (uint256) {
// (a + b) / 2 can overflow, so we distribute
return (a / 2) + (b / 2) + ((a % 2 + b % 2) / 2);
}
function fromUint(uint n, string memory errorMessage) internal pure returns (uint96) {
require(n < 2**96, errorMessage);
return uint96(n);
}
function fromUint(uint n) internal pure returns (uint96) {
return fromUint(n, "SafeMath96: exceeds 96 bits");
}
}
// File contracts/lib/SafeMath32.sol
pragma solidity 0.6.12;
library SafeMath32 {
function add(uint32 a, uint32 b, string memory errorMessage) internal pure returns (uint32) {
uint32 c = a + b;
require(c >= a, errorMessage);
return c;
}
function add(uint32 a, uint32 b) internal pure returns (uint32) {
return add(a, b, "SafeMath32: addition overflow");
}
function sub(uint32 a, uint32 b, string memory errorMessage) internal pure returns (uint32) {
require(b <= a, errorMessage);
return a - b;
}
function sub(uint32 a, uint32 b) internal pure returns (uint32) {
return sub(a, b, "SafeMath32: subtraction overflow");
}
function fromUint(uint n, string memory errorMessage) internal pure returns (uint32) {
require(n < 2**32, errorMessage);
return uint32(n);
}
function fromUint(uint n) internal pure returns (uint32) {
return fromUint(n, "SafeMath32: exceeds 32 bits");
}
}
// File contracts/lib/DelegatableCheckpoints.sol
pragma solidity 0.6.12;
library DelegatableCheckpoints {
/// @dev A checkpoint storing some data effective from a given block
struct Checkpoint {
uint32 fromBlock;
uint192 data;
// uint32 __reserved;
}
/// @dev A set of checkpoints and a 'delegatee'
struct Record {
uint32 numCheckpoints;
uint32 lastCheckpointBlock;
address delegatee;
// uint32 __reserved;
// Checkpoints by IDs
mapping (uint32 => Checkpoint) checkpoints;
// Checkpoint IDs get counted from 1 (but not from 0) -
// the 1st checkpoint has ID of 1, and the last checkpoint' ID is `numCheckpoints`
}
function getCheckpoint(Record storage record, uint checkpointId)
internal view returns (uint32 fromBlock, uint192 data)
{
return checkpointId == 0 || checkpointId > record.numCheckpoints
? (0, 0)
: _getCheckpoint(record, uint32(checkpointId));
}
function _getCheckpoint(Record storage record, uint32 checkpointId)
internal view returns (uint32 fromBlock, uint192 data)
{
return (record.checkpoints[checkpointId].fromBlock, record.checkpoints[checkpointId].data);
}
/**
* @dev Gets the data recorded in the latest checkpoint of the given record
*/
function getLatestData(Record storage record)
internal view returns (uint192, uint32)
{
Record memory _record = record;
return _record.numCheckpoints == 0
? (0, 0)
: (record.checkpoints[_record.numCheckpoints].data, record.checkpoints[_record.numCheckpoints].fromBlock);
}
/**
* @dev Returns the prior data written in the given record' checkpoints as of a block number
* (reverts if the requested block has not been finalized)
* @param record The record with checkpoints
* @param blockNumber The block number to get the data at
* @param checkpointId Optional ID of a checkpoint to first look into
* @return The data effective as of the given block
*/
function getPriorData(Record storage record, uint blockNumber, uint checkpointId)
internal view returns (uint192, uint32)
{
uint32 blockNum = _safeMinedBlockNum(blockNumber);
Record memory _record = record;
Checkpoint memory cp;
// First check specific checkpoint, if it's provided
if (checkpointId != 0) {
require(checkpointId <= _record.numCheckpoints, "ChPoints: invalid checkpoint id");
uint32 cpId = uint32(checkpointId);
cp = record.checkpoints[cpId];
if (cp.fromBlock == blockNum) {
return (cp.data, cp.fromBlock);
} else if (cp.fromBlock < cp.fromBlock) {
if (cpId == _record.numCheckpoints) {
return (cp.data, cp.fromBlock);
}
uint32 nextFromBlock = record.checkpoints[cpId + 1].fromBlock;
if (nextFromBlock > blockNum) {
return (cp.data, cp.fromBlock);
}
}
}
// Finally, search trough all checkpoints
(uint32 checkpointId, uint192 data) = _findCheckpoint(record, _record.numCheckpoints, blockNum);
return (data, record.checkpoints[checkpointId].fromBlock);
}
/**
* @dev Finds a checkpoint in the given record for the given block number
* (reverts if the requested block has not been finalized)
* @param record The record with checkpoints
* @param blockNumber The block number to get the checkpoint at
* @return id The checkpoint ID
* @return data The checkpoint data
*/
function findCheckpoint(Record storage record, uint blockNumber)
internal view returns (uint32 id, uint192 data)
{
uint32 blockNum = _safeMinedBlockNum(blockNumber);
uint32 numCheckpoints = record.numCheckpoints;
(id, data) = _findCheckpoint(record, numCheckpoints, blockNum);
}
/**
* @dev Writes a checkpoint with given data to the given record and returns the checkpoint ID
*/
function writeCheckpoint(Record storage record, uint192 data)
internal returns (uint32 id)
{
uint32 blockNum = _safeBlockNum(block.number);
Record memory _record = record;
uint192 oldData = _record.numCheckpoints > 0 ? record.checkpoints[_record.numCheckpoints].data : 0;
bool isChanged = data != oldData;
if (_record.lastCheckpointBlock != blockNum) {
_record.numCheckpoints = _record.numCheckpoints + 1; // overflow chance ignored
record.numCheckpoints = _record.numCheckpoints;
record.lastCheckpointBlock = blockNum;
isChanged = true;
}
if (isChanged) {
record.checkpoints[_record.numCheckpoints] = Checkpoint(blockNum, data);
}
id = _record.numCheckpoints;
}
/**
* @dev Gets the given record properties (w/o mappings)
*/
function getProperties(Record storage record) internal view returns (uint32, uint32, address) {
return (record.numCheckpoints, record.lastCheckpointBlock, record.delegatee);
}
/**
* @dev Writes given delegatee to the given record
*/
function writeDelegatee(Record storage record, address delegatee) internal {
record.delegatee = delegatee;
}
function _safeBlockNum(uint256 blockNumber) private pure returns (uint32) {
require(blockNumber < 2**32, "ChPoints: blockNum >= 2**32");
return uint32(blockNumber);
}
function _safeMinedBlockNum(uint256 blockNumber) private view returns (uint32) {
require(blockNumber < block.number, "ChPoints: block not yet mined");
return _safeBlockNum(blockNumber);
}
function _findCheckpoint(Record storage record, uint32 numCheckpoints, uint32 blockNum)
private view returns (uint32, uint192)
{
Checkpoint memory cp;
// Check special cases first
if (numCheckpoints == 0) {
return (0, 0);
}
cp = record.checkpoints[numCheckpoints];
if (cp.fromBlock <= blockNum) {
return (numCheckpoints, cp.data);
}
if (record.checkpoints[1].fromBlock > blockNum) {
return (0, 0);
}
uint32 lower = 1;
uint32 upper = numCheckpoints;
while (upper > lower) {
uint32 center = upper - (upper - lower) / 2; // ceil, avoiding overflow
cp = record.checkpoints[center];
if (cp.fromBlock == blockNum) {
return (center, cp.data);
} else if (cp.fromBlock < blockNum) {
lower = center;
} else {
upper = center - 1;
}
}
return (lower, record.checkpoints[lower].data);
}
}
// File contracts/powerindex-mining/DelegatableVotes.sol
pragma solidity 0.6.12;
abstract contract DelegatableVotes {
using SafeMath96 for uint96;
using DelegatableCheckpoints for DelegatableCheckpoints.Record;
/**
* @notice Votes computation data for each account
* @dev Data adjusted to account "delegated" votes
* @dev For the contract address, stores shared for all accounts data
*/
mapping(address => DelegatableCheckpoints.Record) public book;
/**
* @dev Data on votes which an account may delegate or has already delegated
*/
mapping(address => uint192) internal delegatables;
/// @notice The event is emitted when a delegate account' vote balance changes
event CheckpointBalanceChanged(address indexed delegate, uint256 previousBalance, uint256 newBalance);
/// @notice An event that's emitted when an account changes its delegate
event DelegateChanged(address indexed delegator, address indexed fromDelegate, address indexed toDelegate);
/**
* @notice Get the "delegatee" account for the message sender
*/
function delegatee() public view returns (address) {
return book[msg.sender].delegatee;
}
/**
* @notice Delegate votes from `msg.sender` to `delegatee`
* @param delegatee_ The address to delegate votes to
*/
function delegate(address delegatee_) public {
require(delegatee_ != address(this), "delegate: can't delegate to the contract address");
return _delegate(msg.sender, delegatee_);
}
/**
* @notice Get the current votes balance for `account`
* @param account The address to get votes balance
* @return The number of current votes for `account`
*/
function _getCurrentVotes(address account) internal view returns (uint96) {
(uint192 userData, uint32 userDataBlockNumber) = book[account].getLatestData();
if (userData == 0) return 0;
(uint192 sharedData, ) = book[address(this)].getLatestData();
(uint192 sharedDataAtUserSave, ) = book[address(this)].getPriorData(userDataBlockNumber, 0);
return _computeUserVotes(userData, sharedData, sharedDataAtUserSave);
}
/**
* @notice Determine the prior number of votes for the given account as of the given block
* @dev To prevent misinformation, the call reverts if the block requested is not finalized
* @param account The address of the account to get votes for
* @param blockNumber The block number to get votes at
* @return The number of votes the account had as of the given block
*/
function _getPriorVotes(address account, uint256 blockNumber) internal view returns (uint96) {
return _getPriorVotes(account, blockNumber, 0, 0);
}
/**
* @notice Gas-optimized version of the `getPriorVotes` function -
* it accepts IDs of checkpoints to look for votes data as of the given block in
* (if the checkpoints miss the data, it get searched through all checkpoints recorded)
* @dev Call (off-chain) the `findCheckpoints` function to get needed IDs
* @param account The address of the account to get votes for
* @param blockNumber The block number to get votes at
* @param userCheckpointId ID of the checkpoint to look for the user data first
* @param userCheckpointId ID of the checkpoint to look for the shared data first
* @return The number of votes the account had as of the given block
*/
function _getPriorVotes(
address account,
uint256 blockNumber,
uint32 userCheckpointId,
uint32 sharedCheckpointId
) internal view returns (uint96) {
(uint192 userData, uint32 userDataBlockNumber) = book[account].getPriorData(blockNumber, userCheckpointId);
if (userData == 0) return 0;
(uint192 sharedData, ) = book[address(this)].getPriorData(blockNumber, sharedCheckpointId);
(uint192 sharedDataAtUserSave, ) = book[address(this)].getPriorData(userDataBlockNumber, 0);
return _computeUserVotes(userData, sharedData, sharedDataAtUserSave);
}
/// @notice Returns IDs of checkpoints which store the given account' votes computation data
/// @dev Intended for off-chain use (by UI)
function findCheckpoints(address account, uint256 blockNumber)
external
view
returns (uint32 userCheckpointId, uint32 sharedCheckpointId)
{
require(account != address(0), "findCheckpoints: zero account");
(userCheckpointId, ) = book[account].findCheckpoint(blockNumber);
(sharedCheckpointId, ) = book[address(this)].findCheckpoint(blockNumber);
}
function _getCheckpoint(address account, uint32 checkpointId) internal view returns (uint32 fromBlock, uint192 data) {
(fromBlock, data) = book[account].getCheckpoint(checkpointId);
}
function _writeSharedData(uint192 data) internal {
book[address(this)].writeCheckpoint(data);
}
function _writeUserData(address account, uint192 data) internal {
DelegatableCheckpoints.Record storage src = book[account];
address _delegatee = src.delegatee;
DelegatableCheckpoints.Record storage dst = _delegatee == address(0) ? src : book[_delegatee];
(uint192 latestData, ) = dst.getLatestData();
dst.writeCheckpoint(
// keep in mind votes which others could have delegated
_computeUserData(latestData, data, delegatables[account])
);
delegatables[account] = data;
}
function _moveUserData(
address account,
address from,
address to
) internal {
DelegatableCheckpoints.Record storage src;
DelegatableCheckpoints.Record storage dst;
if (from == address(0)) {
// no former delegatee
src = book[account];
dst = book[to];
} else if (to == address(0)) {
// delegation revoked
src = book[from];
dst = book[account];
} else {
src = book[from];
dst = book[to];
}
uint192 delegatable = delegatables[account];
(uint192 srcPrevData, ) = src.getLatestData();
uint192 srcData = _computeUserData(srcPrevData, 0, delegatable);
if (srcPrevData != srcData) src.writeCheckpoint(srcData);
(uint192 dstPrevData, ) = dst.getLatestData();
uint192 dstData = _computeUserData(dstPrevData, delegatable, 0);
if (dstPrevData != dstData) dst.writeCheckpoint(dstData);
}
function _delegate(address delegator, address delegatee_) internal {
address currentDelegate = book[delegator].delegatee;
book[delegator].delegatee = delegatee_;
emit DelegateChanged(delegator, currentDelegate, delegatee_);
_moveUserData(delegator, currentDelegate, delegatee_);
}
function _computeUserVotes(
uint192 userData,
uint192 sharedData,
uint192 sharedDataAtUserSave
) internal pure virtual returns (uint96 votes);
function _computeUserData(
uint192 prevData,
uint192 newDelegated,
uint192 prevDelegated
) internal pure virtual returns (uint192 userData) {
(uint96 prevA, uint96 prevB) = _unpackData(prevData);
(uint96 newDelegatedA, uint96 newDelegatedB) = _unpackData(newDelegated);
(uint96 prevDelegatedA, uint96 prevDelegatedB) = _unpackData(prevDelegated);
userData = _packData(
_getNewValue(prevA, newDelegatedA, prevDelegatedA),
_getNewValue(prevB, newDelegatedB, prevDelegatedB)
);
}
function _unpackData(uint192 data) internal pure virtual returns (uint96 valA, uint96 valB) {
return (uint96(data >> 96), uint96((data << 96) >> 96));
}
function _packData(uint96 valA, uint96 valB) internal pure virtual returns (uint192 data) {
return ((uint192(valA) << 96) | uint192(valB));
}
function _getNewValue(
uint96 val,
uint96 more,
uint96 less
) internal pure virtual returns (uint96 newVal) {
if (more == less) {
newVal = val;
} else if (more > less) {
newVal = val.add(more.sub(less));
} else {
uint96 decrease = less.sub(more);
newVal = val > decrease ? val.sub(decrease) : 0;
}
}
uint256[50] private _gap; // reserved
}
// File contracts/powerindex-mining/VestedLPMining.sol
pragma solidity 0.6.12;
contract VestedLPMining is
OwnableUpgradeSafe,
ReentrancyGuardUpgradeSafe,
ReservedSlots,
DelegatableVotes,
IVestedLPMining
{
using SafeMath for uint256;
using SafeMath96 for uint96;
using SafeMath32 for uint32;
using SafeERC20 for IERC20;
/// @dev properties grouped to optimize storage costs
struct User {
uint32 lastUpdateBlock; // block when the params (below) were updated
uint32 vestingBlock; // block by when all entitled CVP tokens to be vested
uint96 pendedCvp; // amount of CVPs tokens entitled but not yet vested to the user
uint96 cvpAdjust; // adjustments for pended CVP tokens amount computation
// (with regard to LP token deposits/withdrawals in the past)
uint256 lptAmount; // amount of LP tokens the user has provided to a pool
/** @dev
* At any time, the amount of CVP tokens entitled to a user but not yet vested is the sum of:
* (1) CVP token amount entitled after the user last time deposited or withdrawn LP tokens
* = (user.lptAmount * pool.accCvpPerLpt) - user.cvpAdjust
* (2) CVP token amount entitled before the last deposit or withdrawal but not yet vested
* = user.pendedCvp
*
* Whenever a user deposits or withdraws LP tokens to a pool:
* 1. `pool.accCvpPerLpt` for the pool gets updated;
* 2. CVP token amounts to be entitled and vested to the user get computed;
* 3. Token amount which may be vested get sent to the user;
* 3. User' `lptAmount`, `cvpAdjust` and `pendedCvp` get updated.
*
* Note comments on vesting rules in the `function _computeCvpVesting` code bellow.
*/
}
struct Pool {
IERC20 lpToken; // address of the LP token contract
bool votesEnabled; // if the pool is enabled to write votes
uint8 poolType; // pool type (1 - Uniswap, 2 - Balancer)
uint32 allocPoint; // points assigned to the pool, which affect CVPs distribution between pools
uint32 lastUpdateBlock; // latest block when the pool params which follow was updated
uint256 accCvpPerLpt; // accumulated distributed CVPs per one deposited LP token, times 1e12
}
// scale factor for `accCvpPerLpt`
uint256 internal constant SCALE = 1e12;
// The CVP TOKEN
IERC20 public cvp;
// Total amount of CVP tokens pended (not yet vested to users)
uint96 public cvpVestingPool;
// Reservoir address
address public reservoir;
// Vesting duration in blocks
uint32 public cvpVestingPeriodInBlocks;
// The block number when CVP powerindex-mining starts
uint32 public startBlock;
// The amount of CVP tokens rewarded to all pools every block
uint96 public cvpPerBlock;
// The migrator contract (only the owner may ...
// [truncated — 76893 bytes total]
Read Contract
book 0x7ca81460 → uint32, uint32, address
boostBalanceByLp 0xd808b834 → uint256
cvp 0xd8f14f2b → address
cvpAmountNotInBoundsToBoost 0x932bb0a1 → bool
cvpBalanceToBoost 0x8cd0d629 → uint256
cvpPerBlock 0xf247c4b0 → uint96
cvpPoolByMetaPool 0x0795debe → address
cvpVestingPeriodInBlocks 0x866bf7ae → uint32
cvpVestingPool 0x430bf6df → uint96
delegatee 0x1e31d053 → address
findCheckpoints 0xa153d965 → uint32, uint32
getCheckpoint 0x34940fa8 → uint32, uint96, uint96
getCurrentVotes 0xb4b5ea57 → uint96
getPriorVotes 0x6aa7098c → uint96
getPriorVotes 0x782d6fe1 → uint96
isLpTokenAdded 0xab85cfe4 → bool
lastSwapBlock 0xe99f5b80 → uint256
lpBoostMaxRatioByToken 0xbfd05aaa → uint256
lpBoostRatioByToken 0x996517a5 → uint256
migrator 0x7cd07e47 → address
owner 0x8da5cb5b → address
pendingCvp 0x8e782f4d → uint256
poolBoostByLp 0x5754f8d6 → uint256, uint256, uint32, uint256, uint256
poolLength 0x081e3eda → uint256
poolPidByAddress 0xf3f14ed0 → uint256
pools 0xac4afa38 → address, bool, uint8, uint32, uint32, uint256
reservoir 0x151e6aa5 → address
startBlock 0x48cd4cb1 → uint32
totalAllocPoint 0x17caf6f1 → uint256
users 0xb9d02df4 → uint32, uint32, uint96, uint96, uint256
usersPoolBoost 0xcfc2cb60 → uint256, uint32
vestableCvp 0x1db56032 → uint256
votingEnabled 0x7644c30f → bool
Write Contract 19 functions
These functions modify contract state and require a wallet transaction to execute.
add 0x7733fdbb
uint256 _allocPoint
address _lpToken
uint8 _poolType
bool _votesEnabled
uint256 _lpBoostRate
uint256 _cvpBoostRate
uint256 _lpBoostMinRatio
uint256 _lpBoostMaxRatio
checkpointVotes 0x56b2ed53
address _user
delegate 0x5c19a95c
address delegatee_
deposit 0x00aeef8a
uint256 _pid
uint256 _amount
uint256 _boostAmount
emergencyWithdraw 0x5312ea8e
uint256 _pid
initialize 0xd13f90b4
address _cvp
address _reservoir
uint256 _cvpPerBlock
uint256 _startBlock
uint256 _cvpVestingPeriodInBlocks
massUpdatePools 0x630b5ba1
No parameters
renounceOwnership 0x715018a6
No parameters
set 0x85d9aabb
uint256 _pid
uint256 _allocPoint
uint8 _poolType
bool _votesEnabled
uint256 _lpBoostRate
uint256 _cvpBoostRate
uint256 _lpBoostMinRatio
uint256 _lpBoostMaxRatio
setCvpPerBlock 0x9c954c9d
uint256 _cvpPerBlock
setCvpPoolByMetaPool 0x5c2ef9a3
address _metaPool
address _cvpPool
setCvpVestingPeriodInBlocks 0x94f70aca
uint256 _cvpVestingPeriodInBlocks
setCvpVestingPool 0xd6f58088
uint256 _cvpVestingPool
setMigrator 0x23cf3118
address _migrator
setVotingEnabled 0x23868491
bool _isEnabled
transferOwnership 0xf2fde38b
address newOwner
updateBoostBalance 0x9ee5dd88
No parameters
updatePool 0x51eb05a6
uint256 _pid
withdraw 0xa41fe49f
uint256 _pid
uint256 _amount
uint256 _boostAmount
Recent Transactions
No transactions found for this address