Events

Events are a special recording mechanism used to broadcast specific events or messages during the execution of smart contracts.

In this section, we will introduce all Events related to Dyson Finance, which allows smart contracts to interact with external applications, such as decentralized applications (dApps)

Pair Factory

PairCreated Event

This event will be emitted after the Factory creates a Pair for dual investment and DEX.

event PairCreated(address indexed token0, address indexed token1, uint id, address pair);

[token0, token1]*: token0 and token1 are terms used to represent the two tokens in a trading pair. These tokens are sorted according to their addresses to ensure consistency and avoid ambiguity.

Pairs

Swap Event

The Pair represents a DEX trading pair. This event will be emitted when a user attempts to swap tokens within the trading pair.

event Swap(address indexed sender, bool indexed isSwap0, uint amountIn, uint amountOut, address indexed to);

including decimals*: ex: 1000000 amount in USDC represents 1 USDC

Deposit Event

The Pair represents a Dual Investment pair. This event will be emitted when a user attempts to deposit tokens to the pair.

event Deposit(address indexed user, bool indexed isToken0, uint index, uint amountIn, uint token0Amt, uint token1Amt, uint due);

including decimals*: ex: 1000000 amount in USDC represents 1 USDC

Withdraw Event

This event will be emitted when a user attempts to withdraw a note of a pair.

event Withdraw(address indexed user, bool indexed isToken0, uint index, uint amountOut);

including decimals*: ex: 1000000 amount in USDC represents 1 USDC

ApprovalForAll Event

This event will be emitted after a user sets operatorApprovals permission.

event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

Agency

Register Event

When new users want to create a new membership, this event will be emitted.

event Register(uint indexed referrer, uint referee);

Membership(AgentNFT) is transferable through Agency transfer or AgenctNFT transfer. Do not rely solely on Register events to construct the membership tree.

Farm

There are two types of pools to help Farm generate Points for users, please review our other document to understand how to grant Points.

Rate Updated Event

When an action affects two types of "Points" pools on Farm this event will be emitted.

event RateUpdated(address indexed poolId, uint rewardRate, uint weight);

Grant Points Event

When the user deposits on Dual Investment Pair and triggers Farm to grant sp this event will be emitted.

event GrantSP(address indexed user, address indexed poolId, uint amountIn, uint amountOut);

Swap Points to $DYSN Event

When the user swaps anyone's Points to DYSN this event will be emitted.

event Swap(address indexed user, address indexed parent, uint amountIn, uint amountOut);

Staking (sDYSN)

Stake Event

When the user stakes $DYSN to get $sDYSN this event will be emitted.

event Stake(address indexed vaultOwner, address indexed depositor, uint amount, uint sDysonAmount, uint time);

Restake Event

When the user restake $DYSN to get $sDYSN this event will be emitted.

event Restake(address indexed vaultOwner, uint index, uint dysonAmountAdded, uint sDysonAmountAdded, uint time);

Unstake Position Event

When the user redeems $DYSN from staking vaults this event will be emitted.

event Unstake(address indexed vaultOwner, address indexed receiver, uint amount, uint sDysonAmount);

Gauge Factory

Gauge Created Event

This event is emitted when a new Gauge is created, indicating the link from the new Gauge to the existing Pair.

event GaugeCreated(address indexed poolId, address gauge);

Gauge

$sDYSN Deposit Event

This event is emitted when an address deposits $sDYSN to a Gauge

event Deposit(address indexed user, address depositor, uint indexed week, uint amount);

week*: It's the i-th week since 1970/01/01

$sDYSN Apply Withdrawal Event

This event is emitted when an address applies to withdraw $sDYSN from a Gauge.

event ApplyWithdrawal(address indexed user, uint indexed week, uint amount);

week*: It's the i-th week since 1970/01/01

$sDYSN Withdraw Event

This event is emitted when an address withdraws its pending $sDYSN from a Gauge.

event Withdraw(address indexed user, uint amount);

Bribe Factory

Bribe Created Event

This event is emitted when a new Bribe is created and indicates the link to the gauge.

event BribeCreated(address indexed gauge, address bribe);

Bribe

Add Rewards Event

When someone adds rewards to Bribe for users who deposit in Gauge this event will be emitted.

event AddReward(address indexed from, address indexed token, uint indexed week, uint amount);

week*: It's the i-th week since 1970/01/01

Claim Rewards Event

When users claim rewards from Bribe this event will be emitted.

event ClaimReward(address indexed user, address indexed token, uint indexed week, uint amount);

week*: It's the i-th week since 1970/01/01

Last updated