USX
The following describes relevant, public functions on the USX Token smart contract.
Description
The USX.sol
token contract is an ERC20 token contract, augmented with cross-chain capabilities, allowing for seamless token transfers between different blockchains.
Write Methods
sendFrom
This function is used to send USX to an account on another blockchain.
Parameter Name | Type | Description |
---|---|---|
|
| The address of the contract that implements the desired bridge protocol. At present, Ax Protocol mandates that the WormholeBridge address is used for Wormhole-supported chains. The LayerZeroBridge address must only be used for Ax-supported chains that Wormhole does not yet support. See Deployed Contracts page. |
|
| The account that the USX token will be sent from. |
|
| The bridge-protocol-assigned chain identifier for the desired destination chain. |
|
| The abi-encoded recipient address on the destination chain: the account USX will get transferred to. |
|
| The amount of USX token to be transferred, in Wei units (18 decimals). |
Transaction Property | Currency | Description |
---|---|---|
| Source chain native | The amount used to pay for destination chain gas fees. For Wormhole chain routes, use the value returned from sendFeeLookup. For LayerZero chain routes, use the value returned from estimateSendFee. Please refer to the Deployed Contracts page to see the supported chain routes. |
transfer
This ERC20-inherited function is used to send USX to another account on the same blockchain.
Parameter Name | Type | Description |
---|---|---|
|
| The recipient address. |
|
| The amount of USX to be transferred, in Wei units (18 decimals). |
approve
This ERC20-inherited function is used to approve another account on the same blockchain to spend USX on behalf of the approving account.
Parameter Name | Type | Description |
---|---|---|
|
| The address of the account that an allowance should be granted to. |
|
| The amount of USX to be granted as an allowance, in Wei units (18 decimals). |
transferFrom
This ERC20-inherited function allows an account with a pre-approved allowance to transfer USX on behalf of the approving account. Tokens may be transferred to an account on the same blockchain or an account on a different blockchain.
Parameter Name | Type | Description |
---|---|---|
from | address | The address of the account that USX will be sent from. |
to | address | The address of the recipient account. |
amount | address | The amount of USX to transfer, in Wei units (18 decimals). |
View Methods
allowance
This ERC20-inherited function allows an account to check its allowance granted by another account.
Parameter Name | Type | Description |
---|---|---|
|
| The address of the allowance-granter account. |
|
| The address of the allowance recipient account. |
Return Value | Type | Description |
---|---|---|
|
| The USX allowance granted for the spender to use on the owner's behalf, in Wei units (18 decimals).
This amount is |
balanceOf
This ERC20-inherited function allows an account to check its USX balance.
Parameter Name | Type | Description |
---|---|---|
|
| The address of the account that the balance should be retrieved for. |
Return Value | Type | Description |
---|---|---|
|
| The amount of USX an account owns, in Wei units (18 decimals). |
Last updated