ipld-eth-server/test/contract/contracts/GLDToken.sol
Roy Crihfield 688b5c817a Geth 1.13 (Deneb/Cancun) update (#264)
Most notable changes are the updates to the test contracts: due to https://eips.ethereum.org/EIPS/eip-6780, SELFDESTRUCT no longer destroys a contract (unless it occurs in the creating transaction), so CREATE2 can no longer redeploy contracts to the same address.

Reviewed-on: #264
2024-05-29 12:29:55 +00:00

17 lines
428 B
Solidity

pragma solidity ^0.8.25;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract GLDToken is ERC20 {
constructor() ERC20("Gold", "GLD") {
_mint(msg.sender, 1000000000000000000000);
}
function destroy() public {
(bool ok, ) = payable(msg.sender).call{value: address(this).balance}("");
require(ok, "ETH transfer failed");
_burn(msg.sender, balanceOf(msg.sender));
}
}