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
: https://github.com/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:
Transfer
from0x0
toaccount
foramount
emitted onProxysUSD
Issued
amount
toaccount
emitted onProxysUSD
IssuanceDebtRatioEntry
emitted onProxyFeePool
Examples:
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:
Transfer
fromaccount
to0x0
foramount
emitted onProxysUSD
Burned
amount
fromaccount
emitted onProxysUSD
IssuanceDebtRatioEntry
emitted onProxyFeePool
Examples:
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:
Transfer
fromFEE_ADDRESS
to0x0
foramount
emitted onProxysUSD
Burned
amount
fromFEE_ADDRESS
emitted onProxysUSD
Transfer
from0x0
toaccount
foramount
emitted onProxysUSD
Issued
amount
toaccount
emitted onProxysUSD
VestingEntryCreated
emitted onRewardEscrow
FeesClaimed
emitted onProxyFeePool
Examples:
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:
Transfer
fromaccount
to0x0
forfeesOwing
emitted onProxy<synth>
for thesrc
synth.Burned
feesOwing
fromaccount
emitted onProxy<synth>
for thesrc
synth.ExchangeReclaim
fromaccount
forfeesOwing
onsrc
synth emitted onProxySynthetix
.
Else if fees are owed on the src
synth, then these events come first:
Transfer
from0x0
toaccount
forfeesOwed
emitted onProxy<synth>
for thesrc
synth.Issued
feesOwed
toaccount
emitted onProxy<synth>
for thesrc
synth.ExchangeRebate
fromaccount
forfeesOwed
onsrc
synth emitted onProxySynthetix
Read SIP-37 for more information on Fee Reclamation & Rebates.
For every exchange, the following events then occur:
Transfer
fromaccount
to0x0
forfromAmount
emitted onProxy<synth>
for thesrc
synth.Burned
fromAmount
fromaccount
emitted onProxy<synth>
for thesrc
synth.Transfer
from0x0
toaccount
fortoAmount - fee
emitted on onProxy<synth>
for thedest
synth.Issued
toAmount - fee
toaccount
emitted onProxy<synth>
for thedest
synth.Transfer
from0x0
toFEE_ADDRESS
forfee
emitted onProxysUSD
Issued
amount
toFEE_ADDRESS
emitted onProxysUSD
SynthExchange
foraccount
emitted onProxySynthetix
Examples: