BGT

Berachain ERC-20 Token

0x656b95e550c07a9ffe548bd4085c72418ceb1dba

Solidity v0.8.26+commit.8a97fa7a

Fungible token following the ERC-20 standard.

🤖
透過你的 AI 查詢此合約
參考: 0x656b95e550c07a9ffe548bd4085c72418ceb1dba
範例提示詞: "Tell me the current state of berachain/0x656b95e550c07a9ffe548bd4085c72418ceb1dba"
還沒有接入 AI?→ mcp.smarts.md
Berachain 在 Smarts 上是僅文件鏈:原始碼和 ABI 已索引,但目前不提供即時鏈上資料(狀態、最新事件、管理員概覽)。AI 代理仍可透過 MCP 呼叫 get_contract_info 和 get_contract_source。

概覽

讀取函式
32
寫入函式
24
事件
21

讀取函式

CLOCK_MODE() view

Returns the token's clock mode identifier string for consumers and integrations.✨ AI

回傳值

名稱 類型 描述
string String identifier describing the contract's clock mode used by external tools and time logic.✨ AI
activateBoostDelay() view

Returns the activate boost delay.

回傳值

名稱 類型 描述
uint32 The activate boost delay.
allowance(owner: address, spender: address) view

Returns the remaining number of tokens that spender is allowed to transfer from owner.✨ AI

開發者: See {IERC20-allowance}.

參數

名稱 類型 描述
owner address Token holder address whose allowance is being queried.✨ AI
spender address Address authorized to spend tokens on behalf of the owner.✨ AI

回傳值

名稱 類型 描述
uint256 Remaining allowance as a uint256 representing the number of token units spender may transfer from owner.✨ AI
balanceOf(account: address) view

Returns the token balance of the specified account.✨ AI

開發者: See {IERC20-balanceOf}.

參數

名稱 類型 描述
account address Address to query the token balance for.✨ AI

回傳值

名稱 類型 描述
uint256 The token balance of the account as a uint256.✨ AI
bgtTermsAndConditions() view

Return the token's current terms and conditions text.✨ AI

回傳值

名稱 類型 描述
string A single string containing the token's human-readable terms and conditions.✨ AI
boosted(account: address, pubkey: bytes) view

Returns the amount of BGT used by an account to boost a validator.

參數

名稱 類型 描述
account address The address of the account boosting.
pubkey bytes The pubkey of the validator being boosted.

回傳值

名稱 類型 描述
uint128
boostedQueue(account: address, pubkey: bytes) view

Returns the amount of BGT queued up to be used by an account to boost a validator.

參數

名稱 類型 描述
account address The address of the account boosting.
pubkey bytes The pubkey of the validator being boosted.

回傳值

名稱 類型 描述
blockNumberLast uint32
balance uint128
boostees(pubkey: bytes) view

Returns the amount of BGT attributed to the validator for boosts.

參數

名稱 類型 描述
pubkey bytes The pubkey of the validator being boosted.

回傳值

名稱 類型 描述
uint128
boosts(account: address) view

Returns the amount of BGT used by an account for boosts.

參數

名稱 類型 描述
account address The address of the account boosting.

回傳值

名稱 類型 描述
uint128
checkpoints(account: address, pos: uint32) view

Returns the checkpoint data for an account at the specified index.✨ AI

開發者: Get the `pos`-th checkpoint for `account`.

參數

名稱 類型 描述
account address Address whose checkpoint to retrieve.✨ AI
pos uint32 Index of the checkpoint to read (0-based).✨ AI

回傳值

名稱 類型 描述
tuple fromBlock: block number when this checkpoint became effective (uint32).✨ AI
clock() view

Returns the contract's current internal clock value.✨ AI

開發者: Clock used for flagging checkpoints. Can be overridden to implement timestamp based checkpoints (and voting).

回傳值

名稱 類型 描述
uint48 The current internal clock value as a uint48.✨ AI
decimals() view

Returns the number of decimal places used by the token.✨ AI

開發者: Returns the number of decimals used to get its user representation. For example, if `decimals` equals `2`, a balance of `505` tokens should be displayed to a user as `5.05` (`505 / 10 ** 2`). Tokens usually opt for a value of 18, imitating the relationship between Ether and Wei. This is the default value returned by this function, unless it's overridden. NOTE: This information is only used for _display_ purposes: it in no way affects any of the arithmetic of the contract, including {IERC20-balanceOf} and {IERC20-transfer}.

回傳值

名稱 類型 描述
uint8 Number of decimals used by the token for display and arithmetic (uint8).✨ AI
delegates(account: address) view

Returns the address that a token holder has delegated their voting power to.✨ AI

開發者: Returns the delegate that `account` has chosen.

參數

名稱 類型 描述
account address The address of the token holder whose delegate is queried.✨ AI

回傳值

名稱 類型 描述
address The delegatee address currently assigned to the given account; zero address if none.✨ AI
dropBoostDelay() view

Returns the drop boost delay.

回傳值

名稱 類型 描述
uint32 The drop boost delay.
dropBoostQueue(account: address, pubkey: bytes) view

Returns the amount of BGT queued up by an account to drop boost from a validator.

參數

名稱 類型 描述
account address The address of the account dropping boost.
pubkey bytes The pubkey of the validator to drop boost for.

回傳值

名稱 類型 描述
blockNumberLast uint32
balance uint128
eip712Domain() view

Returns the EIP-712 domain parameters used for typed data signing.✨ AI

開發者: See {IERC-5267}.

回傳值

名稱 類型 描述
fields bytes1 Bitmap/discriminator byte indicating which EIP-712 domain fields are present.✨ AI
name string Human-readable domain name used in EIP-712 signing (typically token or contract name).✨ AI
version string EIP-712 domain version string.✨ AI
chainId uint256 Chain identifier (chainId) used for domain replay protection.✨ AI
verifyingContract address Contract address that acts as the verifying contract in the domain.✨ AI
salt bytes32 32-byte domain salt for additional domain separation or entropy.✨ AI
extensions uint256[] List of uint256 extension values for custom or future domain parameters.✨ AI
getPastTotalSupply(timepoint: uint256) view

Return the token total supply as of a specified past timepoint.✨ AI

開發者: Returns the total supply of votes available at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. NOTE: This value is the sum of all available votes, which is not necessarily the sum of all delegated votes. Votes that have not been delegated are still part of total supply, even though they would not participate in a vote. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.

參數

名稱 類型 描述
timepoint uint256 Past timepoint (timestamp or block number used by the contract) to query historical supply.✨ AI

回傳值

名稱 類型 描述
uint256 Total token supply (uint256) recorded at the given past timepoint.✨ AI
getPastVotes(account: address, timepoint: uint256) view

Return the voting power an account had at a specific block number.✨ AI

開發者: Returns the amount of votes that `account` had at a specific moment in the past. If the `clock()` is configured to use block numbers, this will return the value at the end of the corresponding block. Requirements: - `timepoint` must be in the past. If operating using block numbers, the block must be already mined.

參數

名稱 類型 描述
account address The address of the account to query.✨ AI
timepoint uint256 The block number at which to retrieve the account's votes.✨ AI

回傳值

名稱 類型 描述
uint256 The number of votes the account held at the given block number.✨ AI
getVotes(account: address) view

Return the current number of votes assigned to an account.✨ AI

開發者: Returns the current amount of votes that `account` has.

參數

名稱 類型 描述
account address Address whose current voting power to query.✨ AI

回傳值

名稱 類型 描述
uint256 Current number of votes assigned to the account.✨ AI
isWhitelistedSender(sender: address) view

Checks whether a given address is allowed to send tokens.✨ AI

參數

名稱 類型 描述
sender address Address to check for send permissions.✨ AI

回傳值

名稱 類型 描述
bool True if the address is whitelisted to send tokens, otherwise false.✨ AI
minter() view

Public variable that represents the caller of the mint method.

開發者: This is going to be the BlockRewardController contract at first.

回傳值

名稱 類型 描述
address
name() pure

Returns the ERC-20 token name used for user interfaces.✨ AI

開發者: Returns the name of the token.

回傳值

名稱 類型 描述
string The token name string (e.g., "BGT").✨ AI
nonces(owner: address) view

Returns the current replay-protection nonce for an address used with permit signatures.✨ AI

開發者: Returns the next unused nonce for an address.

參數

名稱 類型 描述
owner address Address whose current permit nonce is queried.✨ AI

回傳值

名稱 類型 描述
uint256 Current uint256 nonce for owner; increments after each successful permit to prevent replays.✨ AI
normalizedBoost(pubkey: bytes) view

Returns the normalized boost power for the validator given outstanding boosts.

開發者: Used by distributor get validator boost power.

參數

名稱 類型 描述
pubkey bytes The pubkey of the boosted validator.

回傳值

名稱 類型 描述
uint256
numCheckpoints(account: address) view

Return the number of checkpoints recorded for an account.✨ AI

開發者: Get number of checkpoints for `account`.

參數

名稱 類型 描述
account address Address whose checkpoint count will be returned.✨ AI

回傳值

名稱 類型 描述
uint32 The number of checkpoints (uint32) associated with the account.✨ AI
owner() view

Returns the contract owner's address.✨ AI

開發者: Returns the address of the current owner.

回傳值

名稱 類型 描述
address The address currently designated as the contract owner.✨ AI
queuedBoost(account: address) view

Returns the amount of BGT queued up to be used by an account for boosts.

參數

名稱 類型 描述
account address The address of the account boosting.

回傳值

名稱 類型 描述
uint128
staker() view

Returns the BGT staker contract address.

回傳值

名稱 類型 描述
address The address of the staker.
symbol() pure

Returns the token's short symbol displayed in wallets and user interfaces.✨ AI

開發者: Returns the symbol of the token, usually a shorter version of the name.

回傳值

名稱 類型 描述
string The token's short symbol string, for example BGT.✨ AI
totalBoosts() view

Returns the total boosts for all validators.

回傳值

名稱 類型 描述
uint128
totalSupply() view

Returns the total number of BGT tokens in existence.✨ AI

開發者: See {IERC20-totalSupply}.

回傳值

名稱 類型 描述
uint256 Total number of BGT tokens in existence, expressed as a uint256 in the token's smallest unit.✨ AI
unboostedBalanceOf(account: address) view

Returns the unboosted balance of an account.

參數

名稱 類型 描述
account address The address of the account.

回傳值

名稱 類型 描述
uint256

寫入函式

activateBoost(user: address, pubkey: bytes) nonpayable

Boost the validator with an amount of BGT from `user`.

參數

名稱 類型 描述
user address The address of the user boosting.
pubkey bytes The pubkey of the validator to be boosted.

回傳值

名稱 類型 描述
bool bool False if amount is zero or if enough time has not passed, otherwise true.
approve(spender: address, amount: uint256) nonpayable

Approve spender to transfer up to amount of your BGT tokens from your account.✨ AI

開發者: Only allows approve if the caller is an approved sender.

參數

名稱 類型 描述
spender address Address authorized to spend tokens on your behalf.✨ AI
amount uint256 Maximum token amount the spender is allowed to transfer.✨ AI

回傳值

名稱 類型 描述
bool true if the allowance was set successfully, otherwise false.✨ AI
burnExceedingReserves() nonpayable

Burns the excess BERA held by this contract to redeem BGTs.

開發者: Since CL at deployment is minting to this contract a quantity of native token sufficient to redeem the upper bound of BGT production range, this contract may hold excess BERA. Can burn BERA exceeding BGT.totalSupply() + outstanding rewards.
cancelBoost(pubkey: bytes, amount: uint128) nonpayable

Cancels a queued boost of the validator removing an amount of BGT for `msg.sender`.

開發者: Reverts if `msg.sender` does not have enough queued balance to cover amount.

參數

名稱 類型 描述
pubkey bytes The pubkey of the validator to cancel boost for.
amount uint128 The amount of BGT to remove from the queued boost.
cancelDropBoost(pubkey: bytes, amount: uint128) nonpayable

Cancels a queued drop boost of the validator removing an amount of BGT for sender.

參數

名稱 類型 描述
pubkey bytes The pubkey of the validator to cancel drop boost for.
amount uint128 The amount of BGT to remove from the queued drop boost.
delegate(delegatee: address) nonpayable

Delegate the caller's voting power to the specified address.✨ AI

開發者: Delegates votes from the sender to `delegatee`.

參數

名稱 類型 描述
delegatee address Address that will receive the caller's delegated voting power.✨ AI
delegateBySig(delegatee: address, nonce: uint256, expiry: uint256, v: uint8, r: bytes32, s: bytes32) nonpayable

Delegate voting power to an address using an off-chain EIP-712 signature.✨ AI

開發者: Delegates votes from signer to `delegatee`.

參數

名稱 類型 描述
delegatee address Address receiving the delegated voting power.✨ AI
nonce uint256 Signed nonce to prevent replay of the delegation.✨ AI
expiry uint256 Timestamp after which the signature becomes invalid.✨ AI
v uint8 Recovery byte of the ECDSA signature.✨ AI
r bytes32 First 32 bytes of the ECDSA signature.✨ AI
s bytes32 Second 32 bytes of the ECDSA signature.✨ AI
dropBoost(user: address, pubkey: bytes) nonpayable

Drops an amount of BGT from an existing boost of validator by user.

參數

名稱 類型 描述
user address The address of the user to drop boost from.
pubkey bytes The pubkey of the validator to remove boost from.

回傳值

名稱 類型 描述
bool bool False if amount is zero or if enough time has not passed, otherwise true.
initialize(_owner: address) nonpayable

Initializes the BGT contract.

開發者: Used instead of a constructor to make the `CREATE2` address independent of constructor arguments.

參數

名稱 類型 描述
_owner address
mint(distributor: address, amount: uint256) nonpayable

Mint BGT to the distributor.

開發者: This can only be called by the minter address, which is set by governance.

參數

名稱 類型 描述
distributor address The address of the distributor.
amount uint256 The amount of BGT to mint.
multicall(data: bytes[]) payable

Execute multiple encoded calls in a single transaction and return each call's result.✨ AI

開發者: Apply `delegatecall` with the current contract to each calldata in `data`, and store the `abi.encode` formatted results of each `delegatecall` into `results`. If any of the `delegatecall`s reverts, the entire context is reverted, and the error is bubbled up. By default, this function directly returns the results and terminates the call context. If you need to add before and after actions to the multicall, please override this function.

參數

名稱 類型 描述
data bytes[] Array of encoded function call payloads to execute sequentially within the multicall.✨ AI

回傳值

名稱 類型 描述
bytes[] Array of raw returned bytes from each executed call, in the same order as the input array.✨ AI
queueBoost(pubkey: bytes, amount: uint128) nonpayable

Queues a new boost of the validator with an amount of BGT from `msg.sender`.

開發者: Reverts if `msg.sender` does not have enough unboosted balance to cover amount.

參數

名稱 類型 描述
pubkey bytes The pubkey of the validator to be boosted.
amount uint128 The amount of BGT to use for the queued boost.
queueDropBoost(pubkey: bytes, amount: uint128) nonpayable

Queues a drop boost of the validator removing an amount of BGT for sender.

開發者: Reverts if `user` does not have enough boosted balance to cover amount.

參數

名稱 類型 描述
pubkey bytes The pubkey of the validator to remove boost from.
amount uint128 The amount of BGT to remove from the boost.
redeem(receiver: address, amount: uint256) nonpayable

Redeem the BGT token for the native token at a 1:1 rate.

參數

名稱 類型 描述
receiver address The receiver's address who will receive the native token.
amount uint256 The amount of BGT to redeem.
renounceOwnership() nonpayable

Renounces ownership of the contract, setting the owner to the zero address.✨ AI

開發者: Leaves the contract without owner. It will not be possible to call `onlyOwner` functions. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby disabling any functionality that is only available to the owner.
setActivateBoostDelay(_activateBoostDelay: uint32) nonpayable

Set the activate boost delay.

參數

名稱 類型 描述
_activateBoostDelay uint32 The new delay for activating boosts.
setBgtTermsAndConditions(_bgtTermsAndConditions: string) nonpayable

Set the BGT terms and conditions.

開發者: Only the owner can set the terms and conditions.

參數

名稱 類型 描述
_bgtTermsAndConditions string
setDropBoostDelay(_dropBoostDelay: uint32) nonpayable

Set the drop boost delay.

參數

名稱 類型 描述
_dropBoostDelay uint32 The new delay for dropping boosts.
setMinter(_minter: address) nonpayable

Set the minter address.

開發者: This can only be called by the governance module.

參數

名稱 類型 描述
_minter address The address of the minter.
setStaker(_staker: address) nonpayable

Set the BGT staker contract address.

參數

名稱 類型 描述
_staker address The address of the staker.
transfer(to: address, amount: uint256) nonpayable

Transfer tokens from the caller to a recipient and return true on success.✨ AI

開發者: Only allows transfer if the caller is an approved sender and has enough unboosted balance.

參數

名稱 類型 描述
to address Recipient address.✨ AI
amount uint256 Number of tokens to transfer.✨ AI

回傳值

名稱 類型 描述
bool True if the transfer succeeded.✨ AI
transferFrom(from: address, to: address, amount: uint256) nonpayable

Transfers tokens from one address to another using the caller's allowance.✨ AI

開發者: It spends the allowance of the caller.

參數

名稱 類型 描述
from address Address of the token holder to transfer tokens from.✨ AI
to address Address that will receive the tokens.✨ AI
amount uint256 Amount of tokens to transfer, denominated in the token's smallest unit.✨ AI

回傳值

名稱 類型 描述
bool True if the transfer succeeds.✨ AI
transferOwnership(newOwner: address) nonpayable

Transfers contract ownership to a new owner address.✨ AI

開發者: Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.

參數

名稱 類型 描述
newOwner address Address that will become the new contract owner.✨ AI
whitelistSender(sender: address, approved: bool) nonpayable

Approve an address to send BGT or approve another address to transfer BGT from it.

開發者: BGT should be soul bound to EOAs and only transferable by approved senders.

參數

名稱 類型 描述
sender address The address of the sender.
approved bool Whether the sender is approved or not.

事件

ActivateBoost(sender: address, user: address, pubkey: bytes, amount: uint128)

Emitted when sender activates a new boost for a validator

名稱 類型 已索引 描述
sender address The address of the sender.
user address The address of the user boosting.
pubkey bytes The pubkey of the validator to be activated for the queued boosts.
amount uint128 The amount of BGT to boost with.
ActivateBoostDelayChanged(newDelay: uint32)

Emitted when the activate boost delay is changed.

名稱 類型 已索引 描述
newDelay uint32 The new delay for activating boosts.
Approval(owner: address, spender: address, value: uint256)
名稱 類型 已索引 描述
owner address
spender address
value uint256
BgtTermsAndConditionsChanged(newTermsAndConditions: string)

Emitted when the BGT terms and conditions are changed.

名稱 類型 已索引 描述
newTermsAndConditions string The new terms and conditions.
CancelBoost(user: address, pubkey: bytes, amount: uint128)

Emitted when sender cancels a queued boost for a validator with an amount of BGT

名稱 類型 已索引 描述
user address The address of the user.
pubkey bytes The pubkey of the validator to be canceled from queued boosts.
amount uint128 The amount of BGT to cancel from queued boosts.
CancelDropBoost(user: address, pubkey: bytes, amount: uint128)

Emitted when an user cancels a queued drop boost for a validator.

名稱 類型 已索引 描述
user address The address of the user.
pubkey bytes The pubkey of the validator to cancel drop boost for.
amount uint128 The amount of BGT boost to cancel.
DelegateChanged(delegator: address, fromDelegate: address, toDelegate: address)
名稱 類型 已索引 描述
delegator address
fromDelegate address
toDelegate address
DelegateVotesChanged(delegate: address, previousVotes: uint256, newVotes: uint256)
名稱 類型 已索引 描述
delegate address
previousVotes uint256
newVotes uint256
DropBoost(sender: address, user: address, pubkey: bytes, amount: uint128)

Emitted when sender removes an amount of BGT boost from a validator

名稱 類型 已索引 描述
sender address The address of the sender.
user address The address of the user dropping boost.
pubkey bytes The pubkey of the validator to remove boost from.
amount uint128 The amount of BGT boost to remove.
DropBoostDelayChanged(newDelay: uint32)

Emitted when the drop boost delay is changed.

名稱 類型 已索引 描述
newDelay uint32 The new delay for dropping boosts.
EIP712DomainChanged()
ExceedingReservesBurnt(caller: address, amount: uint256)

Emitted when the native token exceeding reserves are burnt.

名稱 類型 已索引 描述
caller address The address of the caller.
amount uint256 The amount of BERA burnt.
Initialized(version: uint64)
名稱 類型 已索引 描述
version uint64
MinterChanged(previous: address, current: address)

Emitted when the minter address is changed.

名稱 類型 已索引 描述
previous address The address of the previous minter.
current address The address of the current minter.
OwnershipTransferred(previousOwner: address, newOwner: address)
名稱 類型 已索引 描述
previousOwner address
newOwner address
QueueBoost(user: address, pubkey: bytes, amount: uint128)

Emitted when sender queues a new boost for a validator with an amount of BGT

名稱 類型 已索引 描述
user address The address of the user.
pubkey bytes The pubkey of the validator to be queued for boost.
amount uint128 The amount of BGT enqueued for boosting during function call.
QueueDropBoost(user: address, pubkey: bytes, amount: uint128)

Emitted when an user queues a drop boost for a validator.

名稱 類型 已索引 描述
user address The address of the user.
pubkey bytes The pubkey of the validator to remove boost from.
amount uint128 The amount of BGT boost enqueued for dropping boost during function call.
Redeem(from: address, receiver: address, amount: uint256)

Emitted when the BGT token is redeemed for the native token.

名稱 類型 已索引 描述
from address The address of the redeemer.
receiver address The address of the receiver.
amount uint256 The amount of redeemed BGT (and thus, of received BERA).
SenderWhitelisted(sender: address, approved: bool)

Emitted when an address is approved to send BGT.

名稱 類型 已索引 描述
sender address The address of the sender.
approved bool Whether the sender is approved or not.
StakerChanged(previous: address, current: address)

Emitted when the Staker address is changed.

名稱 類型 已索引 描述
previous address The address of the previous Staker.
current address The address of the current Staker.
Transfer(from: address, to: address, value: uint256)
名稱 類型 已索引 描述
from address
to address
value uint256