Augmentlabs StableCoin with AMCF
  • Overview
    • 💡About Us
    • ✨Our Vision
  • Smart Contracts
    • 🪙USC Token
    • 🪙AGC Token
    • ⚖️Token Controller
    • 👨‍🍳MasterChef
    • ⚙️Uniswap Liquidity Auto Provider
    • ⚙️Pancakeswap Liquidity Auto Provider
    • 🕰️Timelock
    • 🔗AGC Governor
Powered by GitBook
On this page
  • Overview
  • How it works
  • Dependencies
  • Roles
  • Participants
  1. Smart Contracts

AGC Token

AGC Token is the asset, the DAO in the ecosystem.

PreviousUSC TokenNextToken Controller

Last updated 2 years ago

Overview

Contract:

AGC Token is an ERC20Upgradeable smart contract that plays an important role in the stablecoin protocol.

AGC Token is our governance token that will be used for voting important decisions.

In the 1st phase of the project, the token will be managed off-chain to ensure that it can't be held by non-whitelisted users.

Initially the total supply will be 18 million tokens, priced at 0.1$ per token as we want the market cap to be 1.8 million USD. The price will fluctuate overtime and we'll perform process to adjust the price (more on this later).

It's of utmost important that AGC token are not allowed to be leaked to non-whitelisted users. Whitelisted users can view their AGC balance, but can't transfer nor burn their tokens.

Augmentlabs will mint new tokens or transfer our own tokens to whitelisted users as they utilize the services in the ecosystem.

For the next phases, AGC token can be used to redeem for by burning AGC and gets minted USC tokens.

How it works

Managed AGC balance

Initially the company address will have 18m tokens. When user buys AGC then we transfer AGC to user's address. User is able to view their AGC balances, but can't transfer or burn them to anyone.

Users holding AGC can take part in on-chain governance by voting.

Rebasement

When the token price is too high, we'll call performRebasement in which we apply a ratio to all user's logical balances (ratio can be either greater of less than 1, but not equal to 1).

When ratio is more than 1, we want to increase all user's AGC balance and by doing so increase the totalSupply to the same ratio. This will reduce the AGC's price as we want.

Total supply should increase/decrease accordingly to this formula: totalSupply *= ratio

We less likely to apply a ratio that is less than 1 but when we find it necessary, perform the rebasement with the ratio.

It's super important that we don't allow the ratio to be 0 (to avoid accidentally vanish everyone's AGC balances) and 1 (this does nothing yet costly, so don't allow this).

The rebasement process will happen in batches using pagination technique. Internally we save every whitelisted users' address in the _users array. We provide a countAllUsers function to get a grasp of how many whitelisted users are there in the system.

When we do the rebasement, we will provide the start/end indices to apply the balance change to all users' balances. Doing so will help avoid out-of-gas issue due to block gas limit should there be too many users in the _users array.

Dependencies

  • ERC20Upgradeable: Openzeppelin's ERC20 smart contract that is upgradeable.

  • Pausable: Allows for pausing/unpausing of the contract.

  • Burnable: Allows for the burning of AGC tokens.

  • Mintable: Allows for minting new AGC tokens to a user.

  • AccessControl: Allows for multiple permission roles to exist in the same contract.

  • ERC20VotesUpgradeable: Allows holders of the AGC token to vote on-chain for governance

Roles

  • Admin (DEFAULT_ADMIN_ROLE): Admin role is able to pause/unpause and do all actions such as: mint, burnFrom and all actions from Operator, Upgrader and Pauser role. Admin role will be held be a gnosis safe address to ensure security and to avoid misusage.

  • Operator (OPERATOR_ROLE): Operator role is able to perform transform, mint , deductFrom, performRebasementand burnFrom actions. Initially no specific address is the holder of the Operator role other than the Admin.

  • Pauser (PAUSER_ROLE): Pauser role is able to pause/unpause the contract in case of emergencies. Initially no specific address is the holder of the Pauser role other than the Admin.

  • Upgrader (UPGRADER_ROLE): Upgrader role is able to upgrade the smart contract for future phases. Initially no specific address is the holder of the Upgrader role other than the Admin.

Participants

  • Gnosis-safe address as Admin: This ensures important roles are secure and doesn't have single-point-of-failure. Also for future extension, Admin can grant roles to other addresses if needed.

  • User: User can't transfer nor burn their AGC tokens. They can view their balance by calling balanceOf just like a traditional ERC20 token.

as Operator: The Token controller will have Operator role as it's a part of the redeem flow. Token controller can mint new AGC tokens in exchange for burning user's USC token as a part of the redeem process.

🪙
TokenController
AGC.sol
USC token
rebasement