AECToken.sol
Core ERC20 token of AetherCycle with Tolerant Fortress tax system; manages protocol revenue before PerpetualEngine processing.
Quick Links
Contract Path:
contracts/core/AECToken.sol
Inherits From
ERC20ERC20BurnableOwnableReentrancyGuardIAECToken
Key State Variables
Public and internal variables representing the token’s configuration, tax system, and protocol integrations.
launchTimestamp
uint256
Immutable deployment timestamp. Determines if initial high-tax period is active.
perpetualEngineAddress
address
Official PerpetualEngine address, authorized to withdraw collected taxes.
primaryAmmPair
address
Primary, official AMM pair for the token.
isExcludedFromTax
mapping(address => bool)
Returns true if an address is exempt from taxes.
automatedMarketMakerPairs
mapping(address => bool)
Returns true if an address is an official AMM pair for tax purposes.
Write Functions
Functions that modify contract state, including transfers, approvals, tax logic, and administrative actions.
transfer(address to, uint256 amount)
Public
Standard ERC20 transfer. Triggers Tolerant Fortress tax logic.
approve(address spender, uint256 amount)
Public
Standard ERC20 approve.
transferFrom(address from, address to, uint256 amount)
Public
Standard ERC20 transferFrom. Triggers Tolerant Fortress tax logic.
burn(uint256 amount)
Public
Allows any user to burn their own tokens, reducing total supply permanently.
approveEngineForProcessing()
Public
Approves the PerpetualEngine to spend collected taxes. Requires minimum balance of 1,000 AEC.
setPerpetualEngineAddress(address _engineAddress)
Owner
Sets the official PerpetualEngine address. Callable once before ownership renouncement.
setPrimaryAmmPair(address pairAddress)
Owner
Sets the primary AMM pair address. Callable once.
setTaxExclusion(address account, bool excluded)
Owner
Grants or revokes tax-exempt status.
setAmmPair(address pair, bool isPair)
Owner
Adds/removes official AMM pairs.
rescueForeignTokens(address tokenAddress)
Owner
Withdraws non-AEC ERC20 tokens sent mistakenly.
renounceContractOwnership()
Owner
Permanently renounces ownership, disabling all owner-only functions.
View Functions
Read-only functions that return balances, allowances, tax rates, and contract state without modifying blockchain data.
balanceOf(address account)
Standard ERC20 balance query.
allowance(address owner, address spender)
Standard ERC20 allowance query.
totalSupply()
Returns total AEC supply.
getCurrentBuyTaxBps()
Returns current buy tax in basis points (e.g., 400 = 4%).
getCurrentSellTaxBps()
Returns current sell tax in basis points.
getUnofficialTaxRates()
Returns high tax rates for unofficial contract interactions.
getContractState()
Returns struct with current state: tax rates, collected tax, engine set status, etc.
Events
Defines all emitted events for monitoring, tracking, and off-chain integration with dApps or analytics tools.
TaxCollected(address from, address to, uint256 taxAmount, bool isBuy, uint16 taxRateBps)
Triggered whenever a tax is successfully collected.
PerpetualEngineApproved(address engineAddress, uint256 amountApproved)
Triggered when approveEngineForProcessing() is successfully called.
PerpetualEngineAddressSet(address newEngineAddress)
Triggered when the PerpetualEngine address is set for the first time.
PrimaryPairSet(address pairAddress)
Triggered when the primary AMM pair is set for the first time.
AmmPairSet(address pair, bool isPair)
Triggered when an address is added/removed from the official AMM pair list.
TaxExclusionSet(address account, bool isExcluded)
Triggered when tax-exempt status changes.
ForeignTokenRescued(address tokenAddress, address to, uint256 amount)
Triggered when foreign tokens are successfully rescued.
Closing Note
This reference completes the overview for AECToken.sol. All functions, state variables, and events are documented above for verification, integration, and direct developer usage.
Last updated