Skip to content

Transactions

Decode transactions with eth-reveal

Our team have written a utility to better decode any transaction in Ethereum, which handles proxies where possible - it works on mainnet and all major testnets and fetches: - the decoded input method and params (the transaction data) - any revert reasons or out of gas (OOG) errors - the output and decoded logs (via the transaction receipt)

It's available in nodejs and as a CLI tool via npm: justinjmoses/eth-reveal

And you can use it live via https://codepen.io/justinjmoses/pen/vwexLj (append ?txn=0x123456... to the URL using the transaction hash to auto-load)

This is a list of the most common user-facing transactions possible in the Synthetix ecosystem, and the events they emit on success.

Staking (Minting/Issuing) sUSD

More info

Check out our staking walkthru for more information

Called contract: ProxyERC20

Target (underlying) contract: Synthetix

Methods:

  • issueSynths(uint256 amount)
  • issueSynthsOnBehalf(address user, uint256)
  • issueMaxSynths()
  • issueMaxSynthsOnBehalf(address user)

Events Emitted:

On a successful transaction, the following events occur:

  1. Transfer from 0x0 to account for amount emitted on ProxysUSD
  2. Issued amount to account emitted on ProxysUSD
  3. IssuanceDebtRatioEntry emitted on ProxyFeePool

Examples:

  • ProxySynthetix.issueSynths(1e18)
  • ProxySynthetix.issueMaxSynths()

Unstaking (Burning) sUSD

More info

Check out our unstaking walkthru for more information

Called contract: ProxyERC20

Target (underlying) contract: Synthetix

Methods:

  • burnSynths(uint256 amount)
  • burnSynthsOnBehalf(address user, uint256 amount)
  • burnSynthsToTarget()
  • burnSynthsToTargetOnBehalf(address user)

Events Emitted:

On a successful transaction, the following events occur:

  1. Transfer from account to 0x0 for amount emitted on ProxysUSD
  2. Burned amount from account emitted on ProxysUSD
  3. IssuanceDebtRatioEntry emitted on ProxyFeePool

Examples:

  • ProxySynthetix.burnSynths(3e18)

  • ProxySynthetix.burnSynthsToTargetOnBehalf(0x3bf10de)

Claiming Fees

More info

Check out our claiming walkthru for more information

Called contract: ProxyFeePool

Target (underlying) contract: FeePool

Methods:

  • claimFees()
  • claimOnBehalf(address user)

Events Emitted:

On a successful transaction, the following events occur:

  1. Transfer from FEE_ADDRESS to 0x0 for amount emitted on ProxysUSD
  2. Burned amount from FEE_ADDRESS emitted on ProxysUSD
  3. Transfer from 0x0 to account for amount emitted on ProxysUSD
  4. Issued amount to account emitted on ProxysUSD
  5. VestingEntryCreated emitted on RewardEscrow
  6. FeesClaimed emitted on ProxyFeePool

Examples:

  • ProxyFeePool.claimFees()

  • ProxyFeePool.claimOnBehalf(0xa16de11)

Trading (Exchanging) synths

More info

Check out our trading walkthru for more information

Called contract: ProxyERC20

Target (underlying) contract: Synthetix

Methods:

  • exchange(bytes32 src, uint256 fromAmount, bytes32 dest)
  • exchangeOnBehalf(address user, bytes32 src, uint256 fromAmount, bytes32 dest)

Events Emitted:

On a successful transaction, the following events occur:

Fee Reclamation (SIP-37)

If fees are owing on the src synth, these events come first:

  1. Transfer from account to 0x0 for feesOwing emitted on Proxy<synth> for the src synth.
  2. Burned feesOwing from account emitted on Proxy<synth> for the src synth.
  3. ExchangeReclaim from account for feesOwing on src synth emitted on ProxySynthetix.

Else if fees are owed on the src synth, then these events come first:

  1. Transfer from 0x0 to account for feesOwed emitted on Proxy<synth> for the src synth.
  2. Issued feesOwed to account emitted on Proxy<synth> for the src synth.
  3. ExchangeRebate from account for feesOwed on src synth emitted on ProxySynthetix

Read SIP-37 for more information on Fee Reclamation & Rebates.

For every exchange, the following events then occur:

  1. Transfer from account to 0x0 for fromAmount emitted on Proxy<synth> for the src synth.
  2. Burned fromAmount from account emitted on Proxy<synth> for the src synth.
  3. Transfer from 0x0 to account for toAmount - fee emitted on on Proxy<synth> for the dest synth.
  4. Issued toAmount - fee to account emitted on Proxy<synth> for the dest synth.
  5. Transfer from 0x0 to FEE_ADDRESS for fee emitted on ProxysUSD
  6. Issued amount to FEE_ADDRESS emitted on ProxysUSD
  7. SynthExchange for account emitted on ProxySynthetix

Examples:

  • ProxySynthetix.exchange(sETH, 100e18, iETH)
  • ProxySynthetix.exchange(iETH, 0.22e18, sUSD) (with a Reclaim)
  • ProxySynthetix.exchange(sETH, 5e18, sUSD) (with a Rebate)