Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
Nonfungibilizer.sol
// This is an alpha contract designed to be proxied
// It is NOT production ready
contract Nonfungiblizer {
bool initDone;
address owner;
address asset;
uint256 value;
constructor () {}
function init(address _asset, uint256 _value) {
require(!initDone);
require(_value > 0, '_value must be greater than 0');
require(
IERC20(_asset).transferFrom(msg.sender, address(this), _value),
'transferFrom failed'
);
asset = _asset;
value = _value;
initDone = true;
}
function withdraw(address _recipient) {
require(msg.sender == owner);
IERC20(_asset).transfer(_recipient, value);
selfdestruct();
}
function transfer(address _newOwner) {
require(msg.sender == owner);
owner = _newOwner;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.