Technical Features
Useful and important information about the IT details of the Smartt-Token
Smart Contract Overview: The SMARTT-Token
The provided Smart Contract code creates an ERC20 token (also called BEP20 at the BSC Network) called SMARTT-Token.
This token incorporates some additional features such as transaction fees, which are used to increase the project's balance and support rewards and token burning.
The code is based on the Solidity programming language (version 0.8.6) and utilizes OpenZeppelin libraries for standard token functionalities and security features.
Solidity and OpenZeppelin
Solidity: Solidity is a high-level, contract-oriented programming language specifically designed for writing Smart Contracts on the Ethereum platform. The code provided is written in Solidity version 0.8.6, which offers improved stability, security, and efficiency compared to earlier versions.
OpenZeppelin: OpenZeppelin is a widely used and audited library that provides secure and tested building blocks for creating Smart Contracts. The code provided imports several OpenZeppelin contracts, such as ERC20, ERC20Burnable, Ownable, and SafeMath, to inherit their functionalities and ensure a secure, compliant, and efficient implementation.
Key Components
ERC20 and ERC20Burnable: The contract inherits from the ERC20.sol and ERC20Burnable.sol libraries, which provide essential token functions such as balance tracking, transfers, etc.
Ownable: The contract inherits from the Ownable.sol library, which helps manage ownership.
SafeMath: The contract imports the SafeMath.sol library and uses it for calculations involving fees and token transfers to prevent arithmetic overflows and underflows, which could lead to vulnerabilities.
Token Features
Transaction Fees: The SMARTT-Token incorporates a fee mechanism, charging users a percentage fee for each transaction. This fee is split equally between the Airdrop Vault and the Burning Wallet. The percentage fee is set during the contract's deployment and can be updated by the contract owner using the setFee function:
Airdrop Vault: This is a designated wallet address that receives a portion of the transaction fees. These funds can be used to support airdrops, rewards, or other initiatives within the project.
Burning Wallet: This is another designated wallet address that receives a portion of the transaction fees. Tokens sent to this wallet are considered "burned" and removed from circulation, which can help reduce the overall token supply and potentially increase the value of the remaining tokens.
Custom Transfer and TransferFrom Functions: The contract overrides the standard ERC20 transfer and transferFrom functions to incorporate the transaction fee mechanism. When a transfer occurs, the specified amount is sent to the recipient, and the fee is deducted from the sender's balance and distributed to the Airdrop Vault and Burning Wallet.
By using Solidity 0.8.6, OpenZeppelin libraries, and implementing custom features such as transaction fees, the provided Smart Contract creates a secure and efficient ERC20 token that supports airdrops and token burning, while allowing for controlled updates by the contract owner. Smart Contract Overview: Holding Smart Contract
The Holding Smart Contract is a staking contract that allows users to stake their tokens in order to achieve various roles based on the amount and duration of their stakes. It is built using Solidity 0.8.6 and leverages OpenZeppelin libraries for the standard ERC20 token functionality and access control.
Key Features:
Role Management: The contract has four predefined roles that users can achieve through staking. Each role has specific time and amount requirements, defined in the 'role' struct.
Staking Function: The 'staking' function enables users to stake their tokens and receive the same amount of staking tokens in return. This function also calculates and updates the user's roles based on the staked amount and role requirements.
Withdraw Function: The 'withdraw' function allows users to withdraw their staked tokens and return the corresponding staking tokens.
Role Checking: The 'getRole' function checks the current role of a user based on their stake.
Technologies Involved:
By using the Holding Smart Contract, users can stake their tokens and earn roles based on the amount and duration of their stakes. This provides an incentive for users to participate in the project and contribute to its growth and success.
Last updated