6 User Message Asset Configurations
6.1 Native Assets vs ERC20
Aspect | Native Assets | ERC20 Tokens |
---|---|---|
ASSET_ID | Address(0) (0x000000...0000 ) | ERC20 token contract address |
Approval Required | Not required | Required before locking funds (Approve spender as Universal Plugin Address) |
msg.value in Deposit | Positive value equivalent to AMOUNT_TOTAL | Always set to 0 |
Target Smart Contract for asset transfers | SurferMonkey Proxy Smart Contract | ERC20 Token Contract |
Function Details for SC asset transfer | "transferEth(address targetAddress, uint256 amount)" | "transfer(address recipient, uint256 amount" |
Payload Amount Native: payloadAmountNative | It is the msg.value from each smart contract call | Use ["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 needmsg.value
set to0
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
Aspect | T-REX Tokens |
---|---|
ASSET_ID | T-REX token contract address |
Whitelisting Requirement | Universal Plugin and Proxy addresses must be whitelisted by the issuer |
Approval Phase | Approval is needed to allow the Universal Plugin to manage token transfers on behalf of the user |
Withdrawal Process | Tokens 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.