P12GameCoin
P12GameCoin
_gameId
string _gameId
Off-chain data, game id
_iconUrl
string _iconUrl
game coin's logo
_name
string _name
override oz erc20 to update both variable
_symbol
string _symbol
constructor
constructor(address owner_, string name_, string symbol_, string gameId_, string iconUrl_, uint256 amount_) public
Name | Type | Description |
---|---|---|
owner_ | address | |
name_ | string | game coin name |
symbol_ | string | game coin symbol |
gameId_ | string | gameId |
iconUrl_ | string | game coin icon's url |
amount_ | uint256 | amount of first minting |
mint
function mint(address to, uint256 amount) external
mint function, the Owner will only be factory contract
Name | Type | Description |
---|---|---|
to | address | address which receive newly-minted coin |
amount | uint256 | amount of the minting |
transferWithAccount
function transferWithAccount(address recipient, string account, uint256 amount) external
transfer function for just a basic transfer with an off-chain account called when a user want to deposit his coin from on-chain to off-chain
Name | Type | Description |
---|---|---|
recipient | address | address which receive the coin, usually be custodian address |
account | string | off-chain account |
amount | uint256 | amount of this transfer |
setName
function setName(string newName) external
set new name
setSymbol
function setSymbol(string newSymbol) external
set new symbol
setGameCoinIconUrl
function setGameCoinIconUrl(string newUrl) external
set new Icon Url
name
function name() public view virtual returns (string)
Returns the name of the token.
symbol
function symbol() public view virtual returns (string)
Returns the symbol of the token, usually a shorter version of the name.
gameId
function gameId() public view virtual returns (string)
Returns the gameId of the token
gameCoinIconUrl
function gameCoinIconUrl() public view virtual returns (string)
Returns the icon url of the token