For the complete documentation index, see llms.txt. This page is also available as Markdown.

Exchange eccUSDC for SHELL via Accumulator

This guide explains how to exchange eccUSDC for SHELL by sending an internal message from a user wallet to the Accumulator contract.

Prerequisites

  • A deployed UpdateCustodianMultisigWallet_v2 wallet; the Acki Nacki Wallet app cannot submit this raw contract transaction. To deploy one: How to deploy a Multisig Wallet

  • The wallet's full <WALLET_DAPP_ID>::<WALLET_ACCOUNT_ID> address and the keys file required to sign transactions

  • The UpdateCustodianMultisigWallet_v2.abi.json ABI file available locally

  • At least 1 eccUSDC (ECC currency ID 3); only whole eccUSDC amounts can be exchanged

  • More than 0.1 VMSHELL in the wallet to cover the message value and transaction fees

Summary

To perform the exchange, send the following to the Accumulator address:

  • eccUSDC as an ECC currency with ID 3;

  • 0.1 VMSHELL (100000000 base units) to execute the message;

  • an empty payload.

The purchased SHELL will be sent back to the address of the contract from which the Accumulator received the message.

The current Accumulator address is:

This is the legacy address format that must be used in ABI fields such as dest, buyer, recipient, and other message parameters.

In tvm-cli 3.x commands where the address is the target of the command itself (--addr, account, runx, or callx), Mainnet/Shellnet requires the full dapp_id::account_id format. The full CLI address of the Accumulator is:

Exchange Rate and Base Units

The exchange rate is fixed:

Message amounts are specified in base units:

  • 1 eccUSDC = 1,000,000 eccUSDC units;

  • 1 SHELL = 1,000,000,000 SHELL units.

The Accumulator accepts only whole USDC amounts. The eccUSDC amount must be greater than zero and divisible by 1,000,000.

Sent

Value in cc["3"]

Received

1 eccUSDC

1000000

100 SHELL

10 eccUSDC

10000000

1,000 SHELL

100 eccUSDC

100000000

10,000 SHELL

Use this formula when preparing the message:

Before You Exchange

1

Confirm the wallet has eccUSDC

The wallet has enough eccUSDC with ID 3.

2

Confirm the wallet has VMSHELL

The wallet has enough VMSHELL to send the message and pay the transaction fee.

3

Confirm the destination

The destination address matches the Accumulator address.

4

Include only eccUSDC

The message contains only one ECC currency: eccUSDC with ID 3.

5

Use a whole-eccUSDC amount

The eccUSDC amount is divisible by 1,000,000.

6

Set the required value and flags

The value field is 100000000 and the flags field is 0.

Message Parameters

Use these parameters to purchase SHELL for 1 USDC:

Field
Value
Purpose

dest

Accumulator address

Contract that performs the exchange

value

100000000

0.1 VMSHELL for executing the internal message

cc

{"3":"1000000"}

1 eccUSDC in base units

bounce

true

Returns the message to the sender if execution fails

flags

0

Deducts the forwarding fee from the specified value

payload

Empty string

Invokes the Accumulator's receive() handler

Use the value = 100000000 and flags = 0. After the fee is deducted, the Accumulator receives approximately 0.098731 VMSHELL, which is enough to execute the exchange. Do not set value = 0: no outgoing message will be created, and the fee for the failed attempt will still be charged.

Some wallets may name the ECC currency field ecc or currencies instead of cc. The meaning is the same: key 3 is the eccUSDC identifier, and its value is the amount in base units.

Send from an UpdateCustodianMultisigWallet_v2 Multisig

For a wallet with one custodian, call the sendTransaction method.

The following Shellnet example exchanges 1 USDC:

For the Mainnet network, use the mainnet.ackinacki.org endpoint.

The dapp_id field in this wallet version is used for transfer reporting. The Accumulator DApp ID is 1.

If the wallet has multiple custodians, use submitTransaction with the same parameters instead of sendTransaction, and then collect the required number of confirmations through the wallet's usual process.

Receive SHELL at Another Address

With an empty payload, the SHELL recipient is msg.sender. If a multisig contract sends the message, the SHELL is credited to that multisig contract's balance.

To send the purchased SHELL to another address, call the following Accumulator method:

First, generate the ABI-encoded call body:

Pass the resulting Message value in the transaction's payload field instead of an empty string. The message must still include eccUSDC with ID 3 and 0.1 VMSHELL for execution.

Example wallet parameters:

The buyer address determines the SHELL recipient. In this case, the SHELL is not returned to the sender.

Verify the Result

1

Confirm the eccUSDC balance decreased

The sender's eccUSDC balance with ID 3 decreases by the amount sent.

2

Confirm the SHELL balance increased

The recipient's SHELL balance with ID 2 increases according to the exchange rate.

3

Check the event

The Accumulator emits a ShellPurchased event.

The event contains:

  • buyer: the SHELL recipient address;

  • usdcAmount: the amount of eccUSDC received;

  • shellFromSellers: SHELL obtained from existing seller orders;

  • shellMinted: additional SHELL minted by the system.

The source of the SHELL does not change the result for the user: shellFromSellers + shellMinted is sent to the recipient in a single transaction.

How the queues, lots and payouts work: Accumulator contract system.

Check the wallet balance with:

For the Mainnet network, use the mainnet.ackinacki.org endpoint.

In the ecc_balance field:

  • key 3 contains the eccUSDC balance in micro-USDC;

  • key 2 contains the SHELL balance in nanoSHELL.

After exchanging 1 USDC, the balance under key 3 should decrease by 1000000, and the balance under key 2 should increase by 100000000000.

Common Errors

Amount Is Not a Whole USDC Value

A cc["3"] value such as 1500000 represents 1.5 USDC and will be rejected. Use only whole amounts such as 1000000, 2000000, or 10000000.

Incorrect ECC ID

Use ID 3 to purchase SHELL. ID 2 represents SHELL and starts a different operation: creating a SHELL sell order.

Multiple ECC Currencies Included

The cc object must contain only one entry with key 3. A message containing multiple ECC currencies will be rejected.

SHELL Was Credited to the Multisig Instead of a Personal Address

This is expected with an empty payload: the recipient is the contract that sent the message. Use buyShellFor if the SHELL must be sent to another address.

Standard TIP-3 USDC Was Used for the Exchange

The Accumulator accepts eccUSDC, the ECC currency with ID 3. Standard TIP-3 USDC must first be converted to eccUSDC through the appropriate bridge.

Important

Last updated