Skip to main content

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
NameTypeDescription
owner_address
name_stringgame coin name
symbol_stringgame coin symbol
gameId_stringgameId
iconUrl_stringgame coin icon's url
amount_uint256amount of first minting

mint

function mint(address to, uint256 amount) external

mint function, the Owner will only be factory contract

NameTypeDescription
toaddressaddress which receive newly-minted coin
amountuint256amount 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

NameTypeDescription
recipientaddressaddress which receive the coin, usually be custodian address
accountstringoff-chain account
amountuint256amount 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