OctopiCoin priceOPI
For more details on listing tiers, refer to Listings Review Criteria Section B - (3).
- Total supply
- 1000T OPI
- Self-reported circulating supply
- 1000T OPI
OctopiCoin community
OctopiCoin News
Top
Top
Latest
Latest
About OctopiCoin
Project Description:
The code provided represents a Solidity smart contract for a token called "OctopiCoin" (OPI). The contract implements functionalities such as token transfers, approvals, allowances, and a transaction tax mechanism. Below is a detailed description of the project based on the code:
Token Details:
- Name: "OctopiCoin"
- Symbol: "OPI"
- Decimals: 18
- Total Supply: The initial supply is set to 1,000,000,000,000,000 (1 quadrillion) tokens, defined in the constructor.
Token Balances and Allowances:
- The contract maintains a mapping called
_balances
, which maps addresses to their corresponding token balances. - The
_balances
mapping is private, meaning it can only be accessed from within the contract. - The contract also maintains a mapping called
_allowances
, which allows token holders to approve other addresses to spend tokens on their behalf.
- The contract maintains a mapping called
Transaction Taxes and Buyback Fee:
- The contract implements a transaction tax mechanism, where a percentage of tokens is deducted from each transaction.
- The transaction tax percentage is defined by the
_transactionTax
variable, initially set to 4%. - Additionally, a buyback fee is applied to the transaction tax amount, defined by the
_buybackFee
variable, initially set to 1%. - The deducted tax amount is sent to a predefined tax receive address (
_taxReceiveAddress
), which is set to0x47F2c317d989108553c43b901433Ab196eC571d7
.
Burn Percentage:
- The contract implements a burning mechanism, where a percentage of tokens is burned (destroyed) in each transaction.
- The burn percentage is defined by the
_burnPercentage
variable, initially set to 10%. - The burned tokens are permanently removed from the total supply.
- The total amount of burned tokens is tracked by the
_totalBurned
variable.
Sell Restriction Time:
- The contract includes a sell restriction mechanism, which prevents token holders from selling their tokens for a specified period.
- The sell restriction time is defined by the
_sellRestrictionTime
variable, initially set to 1 week (604,800 seconds). - The
canSellTokens()
internal function checks if a token holder can sell their tokens based on the time elapsed since their last purchase. - If the sell restriction time has passed, the token holder is allowed to transfer tokens.
Ownership and Function Modifiers:
- The contract includes an owner address,
_owner
, which is set to the deployer of the contract. - The
onlyOwner
modifier ensures that certain functions can only be called by the contract owner. - The modifier requires the message sender (caller) to be the same as the contract owner.
- The contract includes an owner address,
Contract Initialization:
- The constructor function is called upon contract deployment.
- It sets the initial supply of tokens to the contract owner's address and adds the owner to the
_holders
array.
Token Transfer Functions:
- The contract provides functions for transferring tokens between addresses (
transfer()
andtransferFrom()
). - These functions enforce the sell restriction time using the
canSellTokens()
modifier before allowing token transfers. - The
_transfer()
internal function handles the actual transfer of tokens and applies the transaction taxes, buyback fees, and burning.
- The contract provides functions for transferring tokens between addresses (
Approval and Allowance Functions:
- The contract provides functions for approving and checking token allowances (
approve()
andallowance()
). - These functions allow token holders to approve other addresses to spend tokens on their behalf.
- The contract provides functions for approving and checking token allowances (
Getter Functions
:
- The contract provides various getter functions to retrieve token-related information, including total supply (totalSupply()
), token balances (balanceOf()
), purchase timestamps (purchaseTimestamp()
), and the sell restriction time (sellRestrictionTime()
).
Setter Functions:
- The contract includes setter functions (
setTransactionTax()
,setBuybackFee()
, andsetSellRestrictionTime()
) that allow the contract owner to update the transaction tax percentage, buyback fee, and sell restriction time, respectively.
- The contract includes setter functions (
Purchase Tokens Function:
- The
purchaseTokens()
function allows users to mark their address with a purchase timestamp, indicating the time when they acquired tokens. - If the user has a balance of zero tokens, their address is added to the
_holders
array.
- The
Events:
- The contract emits two events,
Transfer()
andApproval()
, whenever token transfers and approvals occur, respectively.
- The contract emits two events,
Overall, the OctopiCoin contract provides a basic implementation of an ERC20-compatible token with additional features such as transaction taxes, burning, sell restrictions, and ownership control.