Smart Contracts
Xion Finance is driven by smart contracts running on the xDai chain and Ethereum Mainnet - powering the whole Xion ecosystem-
Last updated
Was this helpful?
Xion Finance is driven by smart contracts running on the xDai chain and Ethereum Mainnet - powering the whole Xion ecosystem-
Last updated
Was this helpful?
We embrace the ethos of decentralization and want to be as transparent as possible. You can find the code of our smart contracts in our as well as on Blockscout (see the links below).
The Xion Global Token (XGT) is a standard ERC20 token based on the OpenZeppelin contracts. It combines the classic features of ERC20 tokens while combining some advanced mechanisms that we introduced. There is a fixed supply of 3,000,000,000 XGT.
The following features were added on top:
Protection against sending tokens to the token address itself, e.g.:
require(recipient != address(this), "XGT-CANT-TRANSFER-TO-CONTRACT");
A function that burns XGT for our subscription contract (we intend to burn a certain amount of XGT in the future)
Native and cost-efficient swaps between Ethereum Mainnet
Two functions facilitating transfers between Mainnet and the xDai Chain via the
There is also a mainnet version of this contract, which follows the same logic.
Deployed at on the xDai Chain and at on Ethereum mainnet. The code for this contract can be found .
1,200,000,000 XGT have been dedicated to rewarding and incetivizing the users of the Xion community, which amounts to 40% of the overall token supply. This process is being handled in the so-called XGT Generator contract since it "generates" XGT for our users. Users can generate XGT through earning, farming or cash-backs. Having an own contract that can be leveraged via our backend processor allows us to reward our users, even if they are providing liquidity (farming) on pools that are not ours (such as the Honeyswap Pool) or even on other chains (such as on Uniswap on Ethereum Mainnet)
Deployed at . The code for this contract can be found .
Leveraging the , we know how much users provided to our lending protocol on Ethereum Mainnet, such that we can start the generation of XGT for them on the xDai chain. This process doesn't require additional transactions from the user. When withdrawing their DAI on mainnet, the xDai contract is notified through the bridge to stop XGT generation.
For example, the corresponding function (called by the bridge on xDai) after a deposit looks like this:
As soon as a user is involved in a transfer of Pool tokens (either through minting, burning, or simply sending them to another user), our backend node picks this up and calls the XGT generator contract to indicate that a certain users balance was updated. The corresponding function works in a trustless manner, such that the contract itself verifies how many XGT LP tokens the user has. Based on this, the generator of XGT starts (or ends). With our latest promotions in the world of NFTs, we are now also able to grant so-called "boosts", where users may earn a certain percentage of XGT on top for a limited time.
In the future, Xion will also offer cash-backs for users making use of their e-commerce platform. This functionality will be part of a later update.
Users can deposit tokens through this function:
and subsequently, withdraw them with this function:
In order to incentivize the team and investors of Xion over the long-term and also maintaining the ability to facilitate airdrops, we are making use of a standard vesting contract, that distributes the allocated tokens over a period of 24 months. In order to protect the community, any unallocated XGT amounts will also be unlocked throughout the same period, such that the Xion team does not have access to excessive amounts of XGT.
We are leveraging the Upgradeability features by OpenZeppelin, allowing us to introduce features without changing the contract's address as well as fixing any unforeseen bugs that could lead to a financial loss for our users. The safety of our users and consequently their funds is of utmost importance to us!
Over time, the admin and upgradeability mechanisms will be distributed to the community via a governance mechanism.
We are very aware, that working with a different chain than the Ethereum Mainnet still requires some effort on the user's side, while some wallets don't even allow to define custom RPC endpoints. This is mainly the reason, why we are working with establishes mechanisms to bring meta-transactions to our users. Ultimately, we want our users to have very swift and smooth interactions with our system and thus our contracts, without needing to switch between networks or be subject to the hassle of knowing which chain requires which tokens or fees.
GNU Affero General Public License v3.0
This contract facilitates "earning" on Xion Finance. Users can stake their DAI, which is currently converted into cDAI and thus generating interest. Leveraging the , we notify the xDai XGT Generator contract to start generating XGT for the user, which they can claim at any time. Being rewarded with XGT tokens, a small percentage of the interest.
Deployed at . The code for this contract can be found .
Deployed at . The code for this contract can be found .
This is why we are making use of a gas-cost efficient EIP712 Meta Tx standard like .