Inherits: Ownable2Step, Pausable
Collateral deposits are held independently from the IonPool
core contract, but credited to users through gem
balances.
Separating collateral deposits from the core contract allows for handling tokens with non-standard behavior, if needed. This contract implements access control through Ownable2Step
. This contract implements pausing through OpenZeppelin's Pausable
.
Creates a new GemJoin
instance.
Parameters
_pool
IonPool
Address of the IonPool
contract.
_gem
IERC20
ERC20 collateral to be associated with this GemJoin
instance.
_ilkIndex
uint8
of the associated collateral.
owner
address
Admin of the contract.
Pauses the contract.
Pauses the contract.
Unpauses the contract.
Unpauses the contract.
Converts ERC20 token into gem (credit inside of the IonPool
's internal accounting).
Gem will be sourced from msg.sender
and credited to user
.
Parameters
user
address
to credit the gem to.
amount
uint256
of gem to add. [WAD]
Debits gem from the IonPool
's internal accounting and withdraws it into ERC20 token.
Gem will be debited from msg.sender
and sent to user
.
Parameters
user
address
to send the withdrawn ERC20 tokens to.
amount
uint256
of gem to remove. [WAD]