Geode Document Hub
  • Geode Document Hub
  • The Staking Library
    • 🔥The Issue
    • 🧯A Solution
  • Operator Marketplace
    • 🟢A Validator's Lifecycle
    • 🔵Maintenance Fee
    • 🟡Onboarding New Operators
    • 🔴Regulating the Marketplace
      • 🚨Prison
  • Key Concepts
    • 🪙Staking Derivatives
      • G-Derivatives
        • gETH vs gAVAX
    • 🌀Portal
      • 🔐Isolated Storage
      • 🤝Dual Governance
      • ⚠️Limited Upgradability
    • ⚙️Permissionless Configurable Staking Pools
      • 🎭Current Interfaces
      • ⛏️Maintainers
    • 🛡️Withdrawal Contracts
      • ⛑️Recovery Mode
      • 🕗Withdrawal Queue
    • 🌊Bound Liquidity Pools
    • 🔭Oracles
      • Telescope Ether
      • Telescope Avax
    • 👾Future of Geode
      • Better Maintainers (WIP)
      • Synthetic Liquidity (WIP)
      • Dynamic Withdrawals (WIP)
      • Further Decentralization
        • Supporting EIP-4788 (DRAFT)
        • Quadratic Weighted Senate (DRAFT)
        • Degen Operators (DRAFT)
        • Decentralized Telescope (DRAFT)
      • Chain Sync (AVAX) (draft)
  • Ethereum Guides
    • 📗Staking Pool HandBook
      • Initiating a Customizable Staking Pool
      • Managing Your Operator Set
      • Changing Your Pool's Owner
      • Manage Your Maintenance Fee
      • Private Pools and Whitelisting
      • Using a Bound Liquidity Pool
      • Using Maintainers for Your Pool
      • Securing Your Withdrawal Contract
      • Decentralizing Your Pool
    • 📕Operator Handbook
      • Get Onboarded
      • Initiating an Operator
      • Communicating with Portal
      • Creating Validators
      • Changing an Operator's Owner
      • Switching Your Fee
      • Switching Your Validator Period
      • Using Maintainers
      • Optimizing Your Revenue
      • Exiting Validators
    • 📘Liquidity Pool HandBook
  • Avalanche Guides
    • Staking Pool Handbook
    • Operator Handbook
  • Developers
    • Networks
    • Live Contracts
      • Avalanche v1
      • Ethereum v2
        • gETH.sol
        • Portal.sol
          • globals.sol
          • DataStoreUtilsLib.sol
          • GeodeUtilsLib.sol
          • DepositContractUtilsLib.sol
          • OracleUtilsLib.sol
          • StakeUtilsLib.sol
        • Swap.sol
          • AmplificationUtils.sol
          • MathUtils.sol
          • SwapUtils.sol
          • LPToken.sol
        • WithdrawalContract.sol
        • Interfaces
          • ERC20InterfaceUpgaradable.sol
          • ERC20InterfacePermitUpgradable.sol
    • Audits
    • Bug Bounties
Powered by GitBook
On this page
  • Avoiders
  • Denominator
  • priceUpdateTimestamp
  1. Key Concepts
  2. Staking Derivatives
  3. G-Derivatives

gETH vs gAVAX

Improvements to G-Derivatives resulted in some differences between these two ERC1155 contracts.

Avoiders

gAVAX is developed with the assumption that the staker would choose which Staking Pool to stake with. However, it is not hard to see that when people start building on top of Geode, they might want to avoid this assumption.

Avoiders simply prevent the effect of any Interfaces on their g-derivative balance. For example, they can not use their token as an ERC20, as they can not use the ERC20-interface to communicate with the ERC1155 contract.

/**
* @notice Mapping of user addresses who chose to restrict the usage of interfaces
**/
mapping(address => bool) private _interfaceAvoiders;

function isAvoider(address account) public view virtual returns (bool) {
   return _interfaceAvoiders[account];
}

/**
* @notice One can desire to restrict the affect of interfaces on their gETH,
* this can be achieved by simply calling this function
* @param isAvoid true: restrict interfaces, false: allow the interfaces,
**/
function avoidInterfaces(bool isAvoid) external virtual {
   _interfaceAvoiders[_msgSender()] = isAvoid;
   emit InterfacesAvoided(_msgSender(), isAvoid);
}

gAVAX lacks this improvement.

Denominator

The ERC1155 standard does not support "decimals" natively, as ERC20 does. However, both "pricePerShare" and "Balances" need to be denominated in some way. As our auditors warned us, we did not use decimals key as it is already reserved.

uint256 private constant _denominator = 1 ether;

/**
* @notice a centralized denominator = 1e18
*/
function denominator() external view virtual returns (uint256) {
    return _denominator;
}

gAVAX lacks this improvement.

priceUpdateTimestamp

Some DeFi applications, such as a DWP, can be improved with the date of the latest price update from Telescope. It is logical to keep this data here, instead of Portal.

function priceUpdateTimestamp(uint256 id) external view returns (uint256) {
    return _priceUpdateTimestamp[id];
}

function _setPricePerShare(uint256 _price, uint256 _id) internal virtual {
    _pricePerShare[_id] = _price;
    _priceUpdateTimestamp[_id] = block.timestamp; // added this line
}

gAVAX lacks this improvement.

PreviousG-DerivativesNextPortal

Last updated 2 years ago

🪙