GPT Smart Contract
The GPT was issued on two blockchains, Ethereum and Polygon, totaling 100,053,211 tokens. We use the ERC-20 protocol and deployed the contract on both Ethereum and Polygon, particularly because of the fees each network applies, with one being used for retail operations and the other for institutional and large volume operations.
Contract Inheritance
The GPT smart contract inherits properties from several contracts:
ERC20: Standard for fungible tokens.
ERC20Burnable: Allows for the burning of tokens.
ERC20Pausable: Allows for pausing and unpausing transfers and other functionalities, for emergency cases.
AccessControl: Provides role-based access control.
ERC20Permit: Allows for gasless transactions using signatures.
Role Definitions
PAUSER_ROLE: Permission to pause and unpause the contract.
MINTER_ROLE: Permission to create new tokens.
BURNER_ROLE: Permission to burn tokens.
Events
CompensationCompleted: Emitted when a compensation is completed.
TokensBurned: Emitted when tokens are burned.
MetadataURLUpdated: Emitted whenever the metadata URL is updated, providing traceability and visibility of changes made to the metadata reference.
Constructor
Sets the name of the contract, such as GPT, which stands for Greener Preservation Token. It distributes an initial amount of tokens to the entitled wallets. The initial amount of 100,053,211 was split into 3 wallets, with one of them dividing its share between 90% Ethereum and 10% Polygon.
Main Functions
Pause and Unpause:
Allows pausing or unpausing all operations in the contract if the caller has the PAUSER_ROLE.
Mint:
Allows the creation of new tokens if the caller has the permission.
Burn Tokens:
Allows the burning of tokens if the caller has the contract permission and approval from the source wallet of the tokens.
Compensate:
Performs a compensation by burning tokens and recording associated data.
Set Metadata:
Updates the Token Metadata URL, containing documents and files that prove the origin of the tokens.
Get Metadata:
Returns the current reference link for the token metadata.
Generate Hash:
Generates and stores a hash of the provided data. These data are Burn metadata, which ensure the authenticity of each compensation transaction.
Required Overrides:
Overrides of functions for compatibility between inherited contracts.
Last updated