Skip to main content

MintGatewayLogicV1

Reference

Contract: MintGatewayLogicV1​

Gateway handles verifying mint and burn requests. A mintAuthority approves new assets to be minted by providing a digital signature. An owner of an asset can request for it to be burnt.

Inherits from:

  • GatewayStateV2
  • GatewayStateV1
  • IGateway
  • CanReclaimTokens
  • Claimable
  • Ownable
  • Context
  • Initializable


Modifiers​

onlyOwnerOrMintAuthority()​

Only allow the Darknode Payment contract.



Functions​

initialize (contract RenERC20LogicV1 _token, address _feeRecipient, address _mintAuthority, uint16 _mintFee, uint16 _burnFee, uint256 _minimumBurnAmount) (public)​

Params

  • _token: The RenERC20 this Gateway is responsible for.

  • _feeRecipient: The recipient of burning and minting fees.

  • _mintAuthority: The address of the key that can sign mint requests.

  • _mintFee: The amount subtracted each mint request and forwarded to the feeRecipient. In BIPS.

  • _burnFee: The amount subtracted each burn request and forwarded to the feeRecipient. In BIPS.


updateSelectorHash (bytes32 _selectorHash) (public)​

Params

  • _selectorHash: Hash of the token and chain selector. The hash should calculated from SHA256(4 bytes of selector length, selector)

updateSymbol (string symbol) (public)​


claimTokenOwnership () (public)​

Claims ownership of the token passed in to the constructor. transferStoreOwnership must have previously been called. Anyone can call this function.


transferTokenOwnership (contract MintGatewayLogicV1 _nextTokenOwner) (public)​

Allow the owner to update the owner of the RenERC20 token.


updateMintAuthority (address _nextMintAuthority) (public)​

Params

  • _nextMintAuthority: The new mint authority address.

Allow the owner to update the mint authority.


_legacy_updateMintAuthority (address _nextMintAuthority) (public)​

Params

  • _nextMintAuthority: The new legacy mint authority address.

Allow the owner to update the legacy mint authority.


updateMinimumBurnAmount (uint256 _minimumBurnAmount) (public)​

Params

  • _minimumBurnAmount: The new min burn amount.

Allow the owner to update the minimum burn amount.


updateFeeRecipient (address _nextFeeRecipient) (public)​

Params

  • _nextFeeRecipient: The address to start paying fees to.

Allow the owner to update the fee recipient.


updateMintFee (uint16 _nextMintFee) (public)​

Params

  • _nextMintFee: The new fee for minting and burning.

Allow the owner to update the 'mint' fee.


updateBurnFee (uint16 _nextBurnFee) (public)​

Params

  • _nextBurnFee: The new fee for minting and burning.

Allow the owner to update the burn fee.


mint (bytes32 _pHash, uint256 _amountUnderlying, bytes32 _nHash, bytes _sig) → uint256 (public)​

Params

  • _pHash: (payload hash) The hash of the payload associated with the mint.

  • _amountUnderlying: The amount of the token being minted, in its smallest value. (e.g. satoshis for BTC).

  • _nHash: (nonce hash) The hash of the nonce, amount and pHash.

  • _sig: The signature of the hash of the following values: (pHash, amount, msg.sender, nHash), signed by the mintAuthority.

mint verifies a mint approval signature from RenVM and creates tokens after taking a fee for the _feeRecipient.


burn (bytes _to, uint256 _amount) → uint256 (public)​

Params

  • _to: The address to receive the un-bridged asset. The format of this address should be of the destination chain. For example, when burning to Bitcoin, _to should be a Bitcoin address.

  • _amount: The amount of the token being burnt, in its smallest value. (e.g. satoshis for BTC)

burn destroys tokens after taking a fee for the _feeRecipient, allowing the associated assets to be released on their native chain.


getBurn (uint256 _n) → uint256 _blocknumber, bytes _to, uint256 _amount, string _chain, bytes _payload (public)​


verifySignature (bytes32 _sigHash, bytes _sig) → bool (public)​

verifySignature checks the the provided signature matches the provided parameters.


_legacy_verifySignature (bytes32 _sigHash, bytes _sig) → bool (public)​

verifySignature checks the the provided signature matches the provided parameters.


hashForSignature (bytes32 _pHash, uint256 _amount, address _to, bytes32 _nHash) → bytes32 (public)​

hashForSignature hashes the parameters so that they can be signed.


_legacy_hashForSignature (bytes32 _pHash, uint256 _amount, address _to, bytes32 _nHash) → bytes32 (public)​

_legacy_hashForSignature calculates the signature hash used by the 0.2 version of RenVM. It's kept here for backwards-compatibility.



Events​

LogMintAuthorityUpdated (address _newMintAuthority)​


LogMint (address _to, uint256 _amount, uint256 _n, bytes32 _nHash)​


LogBurn (bytes _to, uint256 _amount, uint256 _n, bytes _indexedTo)​