Token Banks
How the token banks work
Last updated
How the token banks work
Last updated
Before an asset is added to the Index, a bank contract for the token needs to be deployed. At deployment, the constructor stores the _manager
address and the IERC20
interface type of the _token
. The _manager
address will normally be the address of the GM Index. The constructor then approves the manager
to spend any amount of the token
on behalf of the Bank. Once the token
’s bank contract has been deployed, and a GM market and price oracle contract exist for the token, the token can be added to the Index (see main GM Index section for adding tokens).
Transfers all tokens in the Bank contract to a new Bank contract. This function can only be called by the manager
.
Name | Type | Description |
---|---|---|
Deposits an _amount
of tokens into the Bank contract. This function can only be called by the manager
, which is normally the GM Index contract. The tokens are sent from the depositor to the GM Index and then immediately sent to the token’s Bank contract.
Name | Type | Description |
---|---|---|
newVault
address
The address of the new Bank contract that all tokens will be transferred to
_amount
uint256
The amount of tokens to deposit