Skip to content

Latest commit

 

History

History
533 lines (339 loc) · 16.4 KB

02_messages.md

File metadata and controls

533 lines (339 loc) · 16.4 KB

Messages

AcceptOwner

MsgAcceptOwner

Broadcasts a transaction that finalizes a transfer of ownership. It accepts the newOwner and completes the two stage process of transferring an owner.

This message accepts no arguments.

Requires:

State changes:

Events emitted:

AddRemoteTokenMessenger

MsgAddRemoteTokenMessenger

Broadcast a transaction that adds a remote token messenger for a provided domain.

Arguments:

Requires:

  • Must be sent from Owner account

State Changes:

Events emitted:

DepositForBurn

MsgDepositForBurn

Broadcast a transaction that deposits for burn to a provided domain.

Arguments:

  • Amount - The burn amount
  • DestinationDomain - Domain of destination chain
  • MintRecipient - address receiving minted tokens on destination chain as a 32 length byte array
  • BurnToken - The burn token address on source domain

Requires:

  • Amount must be positive
  • Amount must be <= PerMessageBurnLimit
  • MintRecipient must not be blank
  • BurnToken must align with a denom that can be minted from the fiattokenfactory
  • BurningAndMintingPaused must be false

State Changes:

Events emitted:

If a Destination Caller is not included, this message calls: SendMessage

If a Destination Caller is included, this message calls: SendMessageWithCaller. See DepositForBurnWithCaller

DepositForBurnWithCaller

MsgDepositForBurnWithCaller

Broadcast a transaction that deposits for burn with caller to a provided domain.

This message wraps MsgDepositForBurn. It adds one extra argument:

Arguments:

  • DestinationCaller - authorized caller as 32 length byte array of receiveMessage() on destination domain

Requires:

  • DestinationCaller must not be blank

DisableAttester

MsgDisableAttester

Broadcast a transaction that disables a provided attester.

Arguments:

  • attester - address of attester to disable.

Requires:

  • Message must be sent from the Attester Manager account
  • You cannot remove an attester if there is currently only one attester. len(storedAttesters) > 0
  • Number of current attesters must be greater than the signature threshold; disallow removing public key if it causes the n in m/n multisig to fall below m (threshold # of signers)

State changes:

Events emitted:

EnableAttester

MsgEnableAttester

Broadcast a transaction that enables a provided attester.

Arguments:

  • attester - address of attester to enable.

Requires:

State changes:

Events emitted:

LinkTokenPair

MsgLinkTokenPair

Broadcast a transaction that links a token pair for a provided domain. This is used for minting/burning. It maps a remote token on a remote domain to a local token.

Arguments:

  • LocalToken - Denom of local token in uunits
  • RemoteToken - The remote token address
  • RemoteDomain - The domain where the message originated from.

Requires:

State changes:

Events emitted:

PauseBurningAndMinting

MsgPauseBurningAndMinting

Broadcast a transaction that pauses burning & minting.

This message accepts no arguments.

Requires:

  • Message must be sent from the Pauser account

State changes:

Events emitted:

PauseSendingAndReceivingMessages

MsgPauseSendingAndReceivingMessages

Broadcast a transaction that pauses sending & receiving messages.

This message accepts no arguments.

Requires:

  • Message must be sent from the Pauser account

State changes:

Events emitted:

ReceiveMessage

MsgReceiveMessage

Broadcast a transaction that receives a provided message from another domain. After validation, it performs a mint.

Arguments:

Requires:

  • SendingAndReceivingMessagesPaused must be false
  • BurningAndMintingPaused must be false
  • if message includes destination caller, then message must be sent from the same address as destination caller
  • message.destinationDomain must be 4 (Noble chain's domain-ID)
  • message.version must be equal to Noble chain's message version (0)
  • message.nonce must not be a used nonce
  • if message.messageBody is a valid burnMessage, then:
    • burnMessage.version must be equal to the hard coded MessageBodyVersion (0)
    • burnMessage.burnToken and message.sourceDomain must be a valid token pair

State changes: - nonce - sets a used nonce

Events emitted:

Valid Attestation

  1. Length of _attestation == 65 (signature length) * signatureThreshold
  2. Addresses recovered from attestation must be in increasing order. For example, if signature A is signed by address 0x1..., and signature B is signed by address 0x2..., attestation must be passed as AB.
  3. No duplicate signers
  4. All signers must be enabled attesters

RemoveRemoteTokenMessenger

MsgRemoveRemoteTokenMessenger

Broadcast a transaction that removes the remote token messenger of a provided domain.

Arguments:

  • domainId

Requires:

  • Must be sent from Owner account

State Changes:

Events emitted:

ReplaceDepositForBurn

MsgReplaceDepositForBurn

Broadcast a transaction that replaces a deposit for burn message. Replace the mint recipient and/or destination caller.

Allows the sender of a previous BurnMessage (created by depositForBurn or depositForBurnWithCaller) to send a new BurnMessage to replace the original. The new BurnMessage will reuse the amount and burn token of the original without requiring a new deposit.

Arguments:

  • OriginalMessage- original message bytes to replace
  • OriginalAttestation- attestation bytes of OriginalMessage
  • NewDestinationCaller - the new destination caller, which may be the same as the original destination caller, a new destination caller, or an empty destination caller, indicating that any destination caller is valid.
  • NewMintRecipient - the new mint recipient. May be the same as the original mint recipient, or different.

Requires:

State Changes:

Events emitted:

This message calls: MsgReplaceMessage

ReplaceMessage

MsgReplaceMessage

Broadcast a transaction that replaces a provided message. Replace the message body and/or destination caller.

Arguments:

  • OriginalMessage - original message bytes to replace
  • OriginalAttestation - attestation bytes of OriginalMessage
  • NewMessageBody - new message body of replaced message
  • NewDestinationCaller - the new destination caller, which may be the same as the original destination caller, a new destination caller, or an empty destination caller, indicating that any destination caller is valid.

Requires:

  • SendingAndReceivingMessagesPaused must be false
  • The attestation signatures of the original message must still be valid. Changing attesters or the signature threshold can render all previous messages irreplaceable
  • Must be sent from the same account as the original message sender
  • The OriginalMessage sourceDomain must be equal to Noble Chain's source domain (4)

State Changes:

Events emitted:

This message calls: SendMessage

SendMessage

MsgSendMessage

Broadcast a transaction that sends a message to a provided domain.

Arguments:

  • DestinationDomain - Domain of destination chain
  • Recipient - Address of message recipient on destination chain
  • MessageBody - Raw bytes content of message

Requires:

State Changes:

Events emitted:

SendMessageWithCaller

MsgSendMessageWithCaller

Broadcast a transaction that sends a message with a caller to a provided domain.

Specifying a Destination caller requires that only the specified caller can call receiveMessage() on destination domain.

This message wraps SendMessage. It adds one extra argument:

Arguments:

  • DestinationCaller - caller on the destination domain, as 32 length byte array

Requires:

  • DestinationCaller cannot be blank

State Changes:

SetMaxBurnAmountPerMessage

MsgSetMaxBurnAmountPerMessage

Broadcast a transaction that updates the max burn amount per message for a provided token.

Arguments:

  • LocalToken - Denom of local token in uunits
  • Amount

Requires:

State Changes:

Events emitted:

UnlinkTokenPair

MsgUnlinkTokenPair

Broadcast a transaction that unlinks a token pair for a provided domain.

Arguments:

  • RemoteDomain - The domain tied to remote token
  • RemoteToken- The remote token address
  • LocalToken - Denom of local token in uunits

Requires:

State Changes:

Events emitted: - TokenPairUnlinked

UpdateAttesterManager

MsgUpdateAttesterManager

Broadcast a transaction that updates the attester manager to the provided address.

Arguments:

  • NewAttesterManager - address of the new attester manager

Requires:

  • Must be sent from Owner account

State Changes:

Events Emitted: AttesterManagerUpdated

UpdateMaxMessageBodySize

MsgUpdateMaxMessageBodySize

Broadcast a transaction that updates the max message body size to the provided size.

Arguments:

  • MessageSize - new max message body size

Requires:

  • Must be sent from Owner account

State Changes:

Events emitted:

UpdateOwner

MsgUpdateOwner

Broadcast a transaction that initiates a transfer of ownership to the provided address.

Arguments:

Requires:

  • Must be sent from Owner account

State Changes:

Events emitted:

UpdatePauser

MsgUpdatePauser

Broadcast a transaction that updates the pauser to the provided address.

Arguments:

  • NewPauser- address of the new pauser

Requires:

  • Must be sent from Owner account

State Changes:

Events emitted:

UpdateSignatureThreshold

MsgUpdateSignatureThreshold

Broadcast a transaction that updates the signature threshold to the provided amount.

Arguments:

  • Amount

Requires:

State Changes:

Events emitted:

UpdateTokenController

MsgUpdateTokenController

Broadcast a transaction that updates the token controller to the provided address.

Arguments:

Requires:

  • Must be sent from Owner account

State Changes:

Events emitted:

UnpauseBurningAndMinting

MsgUnpauseBurningAndMinting

Broadcast a transaction that unpauses burning & minting.

This message accepts no arguments.

Requires:

  • Message must be sent from the Pauser account

State changes:

Events emitted:

UnpauseSendingAndReceivingMessages

MsgUnpauseSendingAndReceivingMessages

Broadcast a transaction that unpauses sending & receiving messages.

This message accepts no arguments.

Requires:

  • Message must be sent from the Pauser account

State changes:

Events emitted: