Skip to main content

LockGatewayLogicV1

Reference

Contract: LockGatewayLogicV1​

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:

  • LockGatewayStateV1
  • CanReclaimTokens
  • Claimable
  • Ownable
  • Context
  • Initializable


Modifiers​

onlyOwnerOrMintAuthority()​

Only allow the Darknode Payment contract.



Functions​

initialize (contract RenERC20LogicV1 _token, address _feeRecipient, address _mintAuthority, uint16 _lockFee, uint16 _releaseFee, 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.

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

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


claimTokenOwnership () (public)​

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


updateMintAuthority (address _nextMintAuthority) (public)​

Params

  • _nextMintAuthority: The address to start paying fees to.

Allow the owner to update the fee recipient.


updateFeeRecipient (address _nextFeeRecipient) (public)​

Params

  • _nextFeeRecipient: The address to start paying fees to.

Allow the owner to update the fee recipient.


updateLockFee (uint16 _nextLockFee) (public)​

Params

  • _nextLockFee: The new fee for locking.

Allow the owner to update the 'mint' fee.


updateReleaseFee (uint16 _nextReleaseFee) (public)​

Params

  • _nextReleaseFee: The new fee for releasing.

Allow the owner to update the burn fee.


lock (string _chain, bytes _to, bytes _payload, uint256 _amount) → uint256 (public)​


release (bytes32 _pHash, uint256 _amount, bytes32 _nHash, bytes _sig) → uint256 (public)​

Params

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

  • _amount: The amount of the token being released, 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.

release verifies a release approval signature from RenVM and sends tokens after taking a fee for the _feeRecipient.


verifySignature (bytes32 _signedMessageHash, 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.



Events​

LogMintAuthorityUpdated (address _newMintAuthority)​


LogLock (bytes _to, bytes _p, uint256 _amount, uint256 _n, bytes _indexedTo)​


LogRelease (address _to, uint256 _amount, uint256 _n, bytes32 _signedMessageHash)​