pragma solidity ^0.4.0;
contract destruct{
uint public money= 48;
address owner;
constructor(){
owner = msg.sender;
}
// modifier OnlyOwner{
// require(msg.sender == owner);
// _;
// }
function increment() public{
money+=10;
}
function kill()public OnlyOwner{
if(msg.sender == owner)
{
selfdestruct(owner);
}
}
}
38.Solidity-Kill(杀死合约)
最新推荐文章于 2024-08-16 23:45:34 发布