GPT 3.0 - Smart Contracts
GPT Smart Contract
Inheritance of Contracts
The GPT smart contract inherits properties from ERC-20 and Ownable contracts. The first is a standard for fungible tokens on the Ethereum blockchain, while the second provides functionalities that allow for the management of contract ownership.
The GPT contract has variables to store the contract's admin (owner), the hash generated with compensation, and two mappings. The first mapping relates compensation hashes to specific data, while the second is used to approve addresses authorized to burn tokens.
Constructor
The GPT contract constructor is used to initialize the contract when it is deployed on the blockchain.
The constructor receives the token's name and symbol, the initial token supply, and the admin's address.
Main Functions
Mint
The mint function allows for the creation of new tokens and can only be called by the contract's owner.
Decimals
The decimals function adjusts the token's decimal places to 6.
Approve Burner
The approveBurner function allows the admin to approve an address as authorized to burn tokens.
Revoke Burner Approval
The revokeBurnerApproval function revokes the admin's approval to burn tokens.
Compensate
The compensate function generates a hash, burns the tokens, and returns the hash for consultation.
Burn Tokens
The burn function allows the owner to burn tokens.
Ownable Contract
The Ownable contract manages the ownership of the contract, allowing for the addition and removal of owners.
Main Functions
Add Owner
The addOwnership function adds a new owner to the contract.
Renounce Ownership
The renounceOwnership function allows an owner to renounce their position.
Verify Owner
The readOwner function returns whether an address is an owner or not.
Last updated