Geode Finance

Building up with Interfaces

ERC1155 Interfaces is a concept that is introduced with g-derivatives.

At first we deploy an ERC-20 interface for every new Planet, but you might want to customize it for your needs in the future :)

First learn what are ERC1155 Interfaces and how to use them.

Simply ERC1155 Interfaces allow maintainers to build on top of their version of yield-bearing Staked tokens, g-derivatives.

Take a look at this case study

Designed and implemented by Developers, they allow your token to be used with the full functionality of a ERC20 token:

The Super Powers of Interfaces

To provide extensive scalability to the implementation of g-derivatives, Interfaces provide some superuser powers for the maintainers.

1. Interfaces are approved by default.

Interfaces are able to mutate user balances without requiring any permissions. By allowing any contract that is approved by the maintainer to be a default implementation for your Staking Pool, you can build a whole protocol on top of it.
Mostly interfaces require a built-in approval process like ERC20 (approve/permit) or ERC721 (setApprovalForAll) to prevent other contracts from mutating your user's balances.
Because of the super powers that are allocated to Interfaces, maintainers should develop these contracts with caution.

2. Interfaces can bypass the ERC1155 requirements while other non-compatible contracts can not receive them.

Since most of the DeFi implementations are not built considering the needs of ERC1155 standard, Interfaces allow your version of ERC1155 to be compatible with any contract within DeFi.

3. Multiple Interfaces can be activated at once.

Your protocol can use the underlying staking data for different purposes, or it may need to be mutated by different contracts for your user's needs. gAVAX and gETH allow the usage of multiple interfaces at once so a new interface doesn’t require a migration.

How to?

function setInterface(
address _Interface,
uint256 _id,
bool isSet }

Activate an interface

Once you have finished implementing your contract and have deployed it, simply call the setInterface function from Portal. To activate your Interface the isSet parameter should be true.
setInterface( {address of your Interface}, {ID of your Staking Pool}, true }

Deactivate an interface

Once you have finished using your old interface, simply call the setInterface function from Portal. To activate your Interface isSet parameter should be false.
setInterface( {address of your Interface}, {ID of your Staking Pool}, false }

Migrate from an old Interface to a new Interface

Interfaces do not require any migration period for your users.
Underlying data of balances can be directly used with the new Interfaces, since it is stored in THE erc1155. However if you have any data stored in your previous implementation, you might need to migrate it.
It is recommended to wait enough time before deactivating for the sake of your users that locked their tokens within the old Interface in another contract.
DO NOT FORGET to deactivate your old Interface once the migration period is over.