Skip to content

Instantly share code, notes, and snippets.

@NukeManDan
Last active November 8, 2020 02:18
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save NukeManDan/d9b260e493af15e62f947a91d503d829 to your computer and use it in GitHub Desktop.
Save NukeManDan/d9b260e493af15e62f947a91d503d829 to your computer and use it in GitHub Desktop.
moonbeam alpha erc20

Deployed Contracts on Moonbase Alpha via Remix

CheckContract address: 0xE0ed028b7fFD18dC1eF0c86ad0533bb2e0c966f8


erc20

0xAA9192fcd515A7DAf29fbe8823a1C3773CFD9663

symbol: NUKE Supply: 123123123000000000000000000

Deployed by account1, giving all 123123123 tokens (18 standard decimals) to it. Sent address2 123 tokens. (tx: 0xcf84d19701e3b503554819c53a50df605d6dec35ea0a9783db7ebed48fa04f1e )

address1 = 0x85aF80C831B61D9D468Fe2cD000333c5546cc4F8 address2 = 0x6Be02d1d3665660d22FF9624b7BE0551ee1Ac91b

approved 123 tokents to spend for: 0x12Cb274aAD8251C875c0bf6872b67d9983E53fDd (tx: 0x1c301a1adc2298050654484aecd48277f381dfe3680d5b978be64d8c9c4d0f48 )

checkContract

Stores requested address values on chain. Depoyed here:

0xE0ed028b7fFD18dC1eF0c86ad0533bb2e0c966f8

(tx: 0x51c65082c1f9b16c3c36d36c0ed3dd075b0fc5163f8224353c8cd8b7703db4d8)

Stored values can be viewed via functions (see contract code below)

pragma solidity ^0.7.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
*/
contract Storage {
address private owner;
address public address1;
address public address2;
address public addressToken;
// event for EVM logging
event OwnerSet(address indexed oldOwner, address indexed newOwner);
// modifier to check if caller is owner
modifier isOwner() {
// If the first argument of 'require' evaluates to 'false', execution terminates and all
// changes to the state and to Ether balances are reverted.
// This used to consume all gas in old EVM versions, but not anymore.
// It is often a good idea to use 'require' to check if functions are called correctly.
// As a second argument, you can also provide an explanation about what went wrong.
require(msg.sender == owner, "Caller is not owner");
_;
}
/**
* @dev Set contract deployer as owner
*/
constructor() public {
owner = msg.sender; // 'msg.sender' is sender of current call, contract deployer for a constructor
emit OwnerSet(address(0), owner);
}
/**
* @dev Store value in variables
*/
function store(address a1, address a2 , address aToken) public isOwner {
address1 = a1 ;
address2 = a2 ;
addressToken = aToken ;
}
/**
* @dev read address1 variable
*/
function reada1() external view returns (address) {
return address1;
}
/**
* @dev read address1 variable
*/
function reada2() external view returns (address) {
return address2;
}
/**
* @dev read address1 variable
*/
function readatoken() external view returns (address) {
return addressToken;
}
}
pragma solidity ^0.6.0;
import 'https://github.com/OpenZeppelin/openzeppelin-contracts/blob/release-v3.1.0/contracts/token/ERC20/ERC20.sol';
// This ERC-20 contract mints the specified amount of tokens to the contract creator.
contract MyToken is ERC20 {
constructor(uint256 initialSupply) ERC20("NukeToken", "NUKE") public {
_mint(msg.sender, initialSupply);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment