Last active
July 1, 2021 02:57
-
-
Save mgraczyk/089f2bca52d8020bdfdc7d54ce333f9d to your computer and use it in GitHub Desktop.
liquidum_pool_1
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// DO NOT USE: Incomplete example code. | |
contract PlotNFT is Ownable { | |
address target; | |
uint256 targetMinBlock; | |
constructor(address _target) public { | |
target = _target; | |
targetMinBlock = 0; | |
} | |
// Called by pool or plot owner to withdraw farmed rewards. | |
function withdraw() public { | |
require(block.number > targetMinBlock, "Target change pending"); | |
target.transfer(this.balance); | |
} | |
// Called by the owner to switch pools or to solo mine. | |
function changeTarget(address _newTarget) public onlyOwner { | |
require(block.number > targetMinBlock, "Target change already pending"); | |
// Approximately 30 minute wait time. | |
targetMinBlock = block.number + 136; | |
target = _newTarget; | |
} | |
// Used by the pool to check where the rewards will go. | |
function getTarget(address) public view returns (address) { | |
return target; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment