Dyson Finance Contract Docs
  • Overview
  • Guides
    • Set Up Your Local Environment
    • Interact with Dyson Finance contracts on Sepolia testnet
    • Integration of Swap
      • Trial Calculation of Swap
      • Perform a Swap
      • Deep Understanding of Swap
    • Integration of Dual Investment
      • Trial Calculation before deposit
      • Perfrom a Dual Investment Deposit
      • Perform a Dual Investment Withdrawal
    • Stake your $DYSN for $sDYSN
    • Boost the Pool by depositing your $sDYSN
    • Sponsorship Reward
  • Technical Reference
    • Overview
    • Core
      • AddressBook
      • DYSON
      • Pair
      • Router
      • PairFactory
      • Membership
        • Agency
        • AgentNFT
      • Fee & Reward distribution
        • FeeDistributor
        • Bribe
      • Staking & Yield Boosting
        • sDYSON
        • Farm
        • Gauge
      • Events
    • Libraries
      • TransferHelper
      • SqrtMath
      • ABDKMath64x64
    • Unit Definition
  • Contract Addresses & Info
    • Blast
    • Polygon zkEVM
    • Linea
    • X Layer
    • Testnet (Sepolia)
    • Testnet (Blast Sepolia)
Powered by GitBook
On this page
  • Pair Factory
  • PairCreated Event
  • Pairs
  • Swap Event
  • Deposit Event
  • Withdraw Event
  • ApprovalForAll Event
  • Agency
  • Register Event
  • Farm
  • Rate Updated Event
  • Grant Points Event
  • Swap Points to $DYSN Event
  • Staking (sDYSN)
  • Stake Event
  • Restake Event
  • Unstake Position Event
  • Gauge Factory
  • Gauge Created Event
  • Gauge
  • $sDYSN Deposit Event
  • $sDYSN Apply Withdrawal Event
  • $sDYSN Withdraw Event
  • Bribe Factory
  • Bribe Created Event
  • Bribe
  • Add Rewards Event
  • Claim Rewards Event
  1. Technical Reference
  2. Core

Events

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

PreviousGaugeNextLibraries

Last updated 11 months ago

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 for dual investment and DEX.

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

token0

address indexed

Sorted tokens index 0*

token1

address indexed

Sorted tokens index 1*

id

uint

The index for Pairs with the same token0-token1 pair

pair

address

The address of created 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 tokens within the trading pair.

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

sender

address indexed

msg.sender who trigger the fuctioin. ex: Router

isSwap0

bool indexed

Indicate the swap input token type. iftoken0, isSwap0 will be true

amountIn

uint

Swap input amount of input type. Including decimals*

amountOut

uint

The result after the swap is processed. Including decimals*

to

address indexed

The address that receives the swap result

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

Deposit Event

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

user

address indexed

user who could claim this position

isToken0

bool indexed

Indicate the deposit input token type. iftoken0, isToken0 will be true

index

uint

amountIn

uint

Deposit input amount of input type. Including decimals*

token0Amt

uint

The potential position ampount in token0 that the user may receive upon expiration. Including decimals*

token1Amt

uint

The potential position amount in token1 that the user may receive upon expiration. Including decimals*

due

uint

The Unix timestamp represents the time when the user can claim the position.

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

Withdraw Event

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

user

address indexed

user who own the claimed position

isToken0

bool indexed

The claimed token type for withdrawal. If the output token is of type token0, then isToken0 will be set to true.

index

uint

amountOut

uint

The position claimed amount. Including decimals*

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

ApprovalForAll Event

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

owner

address indexed

Target user address who delegate control of their Note to the operator.

operator

bool indexed

Address that delegates authority to control the owner's Note.

approved

bool

The permissin is set approved (true) or not.

Agency

Register Event

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

event Register(uint indexed referrer, uint referee);
Arguments
Type
Description

referrer

uint indexed

Referrer id in map agents, could use to retrieve referrer's Agent

referee

uint

The new user id in map agents, could use to retrieve new user's Agent

Farm

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);
Arguments
Type
Description

poolId

address indexed

The Pair Address or Farm Address. Which can be used to retrieve the Pool structure from the pools map. If the address is associated with a Farm, it indicates that the global pool is being updated. If the address is associated with a Pair, it indicates that the local pool is being updated.

rewardRate

uint

Updated RewardRate Decimals: 18

weight

uint

Updated Weight Decimals: 18

Grant Points Event

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

user

address indexed

Address which will receive the Points

poolId

address indexed

The dual investment pair address

amountIn

uint

Amount of a internal used parameters "localSP" Decimals: 18

amountOut

uint

Amount of Points with 18 decimals

Swap Points to $DYSN Event

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

user

address indexed

The address that spends its own Points to exchange for DYSN.

parent

address indexed

The parent who could get 1/3 Points commission.

amountIn

uint

Spent Points amounts for DYSN Decimals: 18

amountOut

uint

The DYSN amounts user received Decimals: 18

Staking (sDYSN)

Stake Event

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

vaultOwner

address indexed

The address that received $sDYSN and voting power, and owns the position.

depositor

address indexed

The address which deposit $DYSN (msg.sender)

amount

uint

The amount of $DYSN staked this time. Decimals: 18

sDysonAmount

uint

The amount of $sDYSN minted this time. Which is equal to the additional voting power the vault owner gets. Decimals: 18

time

uint

The lock duration from now for this $DYSN position. unit: secounds

Restake Event

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

vaultOwner

address indexed

The address that received $sDYSN and voting power, and owns the position.

index

uint

The vaults index to indicate which position was updated vaults[vaultOwner][indx]

dysonAmountAdded

uint

The amount of $DYSN staked this time. Decimals: 18

sDysonAmountAdded

uint

The amount of $sDYSN minted this time. Which is equal to the additional voting power the vault owner gets. Decimals: 18

time

uint

The lock duration from now for this $DYSN position. unit: secounds

Unstake Position Event

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

vaultOwner

address indexed

The address that owns the position.

receiver

address indexed

Address that will receive $DYSN

amount

uint

The amount of $DYSN unstaked this time. Decimals: 18

sDysonAmount

uint

The amount of $sDYSN burned this time. Which is equal to the reduction in the voting power of the vault owner. Decimals: 18

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);
Arguments
Type
Description

poolId

address indexed

Pair contract address link to new deployed Gauge contract.

gauge

address

New deployed Gauge contract address

Gauge

$sDYSN Deposit Event

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

user

address indexed

Owner of this deposit position

depositor

address

Address that deposit $sDYSN (msg.sender)

week

uint indexed

The week* in which this deposit position was added

amount

uint

Added $sDYSN Amount Decimals: 18

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

$sDYSN Apply Withdrawal Event

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

user

address indexed

Owner of this deposit position (msg.sender)

week

uint indexed

The week* in which this position amount was removed

amount

uint

This applies to withdrawing the $sDYSN amount Decimals: 18

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

$sDYSN Withdraw Event

event Withdraw(address indexed user, uint amount);
Arguments
Type
Description

user

address indexed

Owner of this pending withdrawal position (msg.sender)

amount

uint

The amount of $sDYSN received by the user

Decimals: 18

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);
Arguments
Type
Description

gauge

address indexed

Gauge contract address link to new deployed Bribe contract.

bribe

address

New deployed Bribe contract address

Bribe

Add Rewards Event

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

from

address indexed

The address that deposit token rewards (msg.sender)

token

address indexed

The added reward token address

week

uint indexed

The week* to add the reward to.

amount

uint

The amount of added reward tokens. Decimals: by token

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

Claim Rewards Event

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

user

address indexed

The address that claimed and received the token rewards (msg.sender).

token

address indexed

The claimed reward token address

week

uint indexed

The week* to claim the reward from.

amount

uint

The amount of claimed reward tokens. Decimals: by token

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

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

The index of this deposit action.

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

The index of this withdraw action.

This event will be emitted after a user permission.

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

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

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

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

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

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

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

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

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

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

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

When users rewards from Bribe this event will be emitted.

deposit
other documen
swaps
grant sp
creates a Pair
swap
withdraw
sets operatorApprovals
deposits
Note
Note
adds rewards
claim
restake
redeems
transfer
deposits
applies to withdraw
withdraws
transfer
stakes