RUSD (Ring USD)
The Ring USD stablecoin
RUSD is a regular ERC-20 token, based on the OpenZeppelin ERC-20Burnable code with the following modifications:
Minting and burning to any address are uncapped and accessible by any address with the Minter💰and Burner🔥 role, respectively.
At each transfer (or transferFrom) the following addresses are checked for a mapped incentive contract:
- RUSD sender
- RUSD receiver
- RUSD operator (msg.sender) - commonly the same as the sender unless using transferFrom with an approved contract
- the zero address - represens an incentive to be applied on ALL transfers
If an incentive contract is found, it is called with all of the transfer parameters. Any incentive is applied after the token balances update from the transfer.
Minting
Burning
IncentiveContractUpdate
Minting RUSD to an address
type | param | description |
address indexed | _to | The recipient of the minted RUSD |
address indexed | _minter | The contract that minted the RUSD |
uint256 | _amount | The amount of RUSD minted |
Burning RUSD from an address
type | param | description |
address indexed | _to | The target of the burned RUSD |
address indexed | _burner | The contract that burned the RUSD |
uint256 | _amount | The amount of RUSD minted |
setting or unsetting an incentive contract for an incentivized address
type | param | description |
address indexed | _incentivized | The incentivized address |
address indexed | _incentiveContract | The new incentive contract. address(0) to unset |
function incentiveContract(address account) external view returns (address);
returns the mapped incentive contract if
account
is an incentivized address, otherwise returns the 0 address.if the 0 address has a mapped incentive contract, then this incentive contract is called for every single RUSD transfer.
function burnFrom(address account, uint256 amount) external;
Burns
amount
RUSD from account
. Reverts if the RUSD balance of account
is less than amount
emits
Burning
function mint(address account, uint256 amount) external;
Mints
amount
RUSD to account
emits
Minting
function setIncentiveContract(address account, address incentive) external;
Sets the incentive contract
incentive
for account
. If incentive
is the 0 address this functions as an unset.emits
IncentiveContractUpdate
function burn(uint256 amount) external;
Burns
amount
RUSD from msg.sender
. Reverts if the RUSD balance of msg.sender
is less than amount
emits
Burning
function permit(
address owner,
address spender,
uint256 value,
uint256 deadline,
uint8 v,
bytes32 r,
bytes32 s
) external;
Sets the allowance for a
spender
for value
RUSD from owner
via signature. Reverts if called after deadline
rusd.json
7KB
Code
Rusd ABI
irusd.json
4KB
Code
Rusd Interface ABI
Last modified 2yr ago