Test Tokens
Deploy and interact with tokens easily using simple function calls.
Creating a Test Token
Test tokens are regular ERC20s with a public function that allows the owner to mint them at will.
reaper.deployTestToken(name: string, symbol: string) => (address:string)
Example of a Test Token deployment utilizing the BigGas constant to ensure execution:
Viewing Your Token's Metadata
Return an object which contains all relevant metadata for your test token or any other ERC20.
reaper.getTokenMetadata(tokenAddress: string) =>
({
name:string,
symbol:string,
decimals: uint,
totalSupply: uint,
owner: string
})
Fetching metadata for the above test token deployment:
Minting Test Tokens
ReaperSDK's built-in test token allows the owner to mint infinitely to any address.
reaper.mintTestToken(tokenAddress: string, userAddress: string, amount: uint) =>
(userBalance:BigNumber)
Minting to multiple addresses with Reaper's parseToken function and viewing their updated balances:
Viewing a User's Token Balances
Check any user's Fantom or ERC20 balance with simple inputs.
reaper.getUserBalance(userAddress:string, [tokenAddress:string]) =>
(userBalance:BigNumber)
Approving Tokens
We took the thinking out of approvals with a simple maximum approval for any token input array. The second input can be a single address or an array of addresses - single addresses will be formatted into an array of length 1.
reaper.approveMax(spenderAddress:string, tokenAddresses:string[ ]) => "success"
Last updated
Was this helpful?