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.


  • 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.


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.

constructor(address defaultAdmin, address pauser, address minter, address burner, uint256 initialSupplyCluster1, uint256 initialSupplyCluster2, address cluster2Address, uint256 initialSupplyCluster3, address cluster3Address)
ERC20("GPT", "GPT")
    _grantRole(DEFAULT_ADMIN_ROLE, defaultAdmin);
    _grantRole(PAUSER_ROLE, pauser);
    _grantRole(MINTER_ROLE, minter);
    _grantRole(BURNER_ROLE, burner);
    _mint(msg.sender, initialSupplyCluster1);
    _mint(cluster2Address, initialSupplyCluster2);
    _mint(cluster3Address, initialSupplyCluster3);

Main Functions

Pause and Unpause:

Allows pausing or unpausing all operations in the contract if the caller has the PAUSER_ROLE.

function pause() public onlyRole(PAUSER_ROLE);
function unpause() public onlyRole(PAUSER_ROLE);


Allows the creation of new tokens if the caller has the permission.

function mint(address to, uint256 amount) public onlyRole(MINTER_ROLE);

Burn Tokens:

Allows the burning of tokens if the caller has the contract permission and approval from the source wallet of the tokens.

function burnFrom(address account, uint256 amount) public virtual override onlyRole(BURNER_ROLE) {
    super.burnFrom(account, amount);


Performs a compensation by burning tokens and recording associated data.

function compensate(address from, uint256 amount, string[] memory data) public onlyRole(BURNER_ROLE) returns (bool);

Set Metadata:

Updates the Token Metadata URL, containing documents and files that prove the origin of the tokens.

function setMetadataURL(string memory newURL) public onlyRole(DEFAULT_ADMIN_ROLE) {
    _metadataURL = newURL;
    emit MetadataURLUpdated(newURL);

Get Metadata:

Returns the current reference link for the token metadata.

function getMetadataURL() public view returns (string memory) {
    return _metadataURL;

Generate Hash:

Generates and stores a hash of the provided data. These data are Burn metadata, which ensure the authenticity of each compensation transaction.

function _generateHash(string[] memory data) internal returns (bytes32);

Required Overrides:

Overrides of functions for compatibility between inherited contracts.

function _update(address from, address to, uint256 value) internal override(ERC20, ERC20Pausable);

Last updated