This is a proposal to convert the Ricochet (RIC) SuperToken to a regular ERC20 token called REX Protocol Token (REX). A new ERC20 contract using OpenZepplin’s ERC20 contract with a custom function for burning RIC tokens for REX tokens one for one (1:1). Moving from a SuperToken to a standard ERC20 token removes a significant amount of attack surface from the protocol. REX is more secure since it removes the SuperToken logic and the upgradability from the RIC token.
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract REXProtocolToken is ERC20 {
ERC20 public constant RICOCHET_TOKEN = ERC20(0x263026E7e53DBFDce5ae55Ade22493f828922965);
constructor() ERC20("REX Protocol Token", "REX") {
}
function supportREX(uint amount) external {
// Burn the SuperToken
require(RICOCHET_TOKEN.transfer(address(0), amount), "burn failed");
// Mint the new REX token to 1:1
_mint(msg.sender, amount);
}
}
Since RIC has a max supply of 10M, REX will also have a max supply of 10M too.