Skip to main content

6 User Message Asset Configurations

6.1 Native Assets vs ERC20

AspectNative AssetsERC20 Tokens
ASSET_IDAddress(0) (0x000000...0000)ERC20 token contract address
Approval RequiredNot requiredRequired before locking funds (Approve spender as Universal Plugin Address)
msg.value in DepositPositive value equivalent to AMOUNT_TOTALAlways set to 0
Target Smart Contract for asset transfersSurferMonkey Proxy Smart ContractERC20 Token Contract
Function Details for SC asset transfer"transferEth(address targetAddress, uint256 amount)""transfer(address recipient, uint256 amount"
Payload Amount Native: payloadAmountNativeIt is the msg.value from each smart contract callUse ["0", "0", "0", ...], ignored but mandatory. Constrained in the bytecalldata.

Key Points:

  • Approval Phase for ERC20: Before locking ERC20 assets into the Universal Plugin, you need to approve the plugin to spend the tokens on your behalf.
  • msg.value Handling: Native assets require msg.value in the deposit, while ERC20 tokens need msg.value set to 0 to prevent transaction failures.
  • Smart Contract Calls: For native assets transfers, the SurferMonkey Proxy handles the transfer (transferEth). For ERC20 tokens, direct interaction with the token contract is required (transfer).

6.2 T-REX Standard

The T-REX token standard extends the ERC20 standard with compliance requirements, such as identity verification and whitelisting. Organizations using T-REX must whitelist the SurferMonkey Universal Plugin Smart Contract Address and the SurferMonkey Proxy Smart Contract Address.

Key Differences for T-REX Integration:

  • Whitelisting: Both the Universal Plugin and Proxy addresses need to be whitelisted by the issuer.

  • Deposit Phase: Tokens are locked in the Universal Plugin.

  • Withdraw Phase: Tokens are released from the Universal Plugin, transferred to the Proxy, and then sent to the final recipient.

Summary Table for T-REX Integration

AspectT-REX Tokens
ASSET_IDT-REX token contract address
Whitelisting RequirementUniversal Plugin and Proxy addresses must be whitelisted by the issuer
Approval PhaseApproval is needed to allow the Universal Plugin to manage token transfers on behalf of the user
Withdrawal ProcessTokens move from the Universal Plugin to Proxy before being transferred to recipients

Key Points:

  • Whitelist Both Addresses: Ensure both the Universal Plugin and Proxy addresses are whitelisted by the organization controlling the T-REX token.

  • Approval and Compliance: Prior to a deposit, tokens must be approved for the Universal Plugin. During the withdrawal phase, tokens are transferred through the Proxy, allowing for compliance checks to be executed seamlessly.