Accounts

Celo

0x7d21685c17607338b313a7174bab6620bad0aab7

Proxy 實作合約: 0x907f5c53c0e31db06af45bc58f076563469c525a

Solidity v0.5.13+commit.5b0b510c

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

概覽

讀取函式
41
寫入函式
29
事件
26

讀取函式

EIP712_AUTHORIZE_SIGNER_TYPEHASH() view

Returns the EIP-712 typehash used to authorize a signer.✨ AI

回傳值

名稱 類型 描述
bytes32 The bytes32 EIP-712 typehash for the AuthorizeSigner struct.✨ AI
attestationSignerToAccount(signer: address) view

Returns the account associated with `signer`.

開發者: Fails if the `signer` is not an account or currently authorized attestation signer.

參數

名稱 類型 描述
signer address The address of the account or currently authorized attestation signer.

回傳值

名稱 類型 描述
address The associated account that the signer is authorized to attest for.
authorizedBy(address) view

Return the address that authorized the given account.✨ AI

參數

名稱 類型 描述
address

回傳值

名稱 類型 描述
address Address that authorized the provided account, or the zero address if none.✨ AI
batchGetMetadataURL(accountsToQuery: address[]) view

Getter for the metadata of multiple accounts.

參數

名稱 類型 描述
accountsToQuery address[] The addresses of the accounts to get the metadata for.

回傳值

名稱 類型 描述
uint256[] The length of each string in bytes.
bytes All strings concatenated.
eip712DomainSeparator() view

Return the EIP-712 domain separator used for signing typed data.✨ AI

回傳值

名稱 類型 描述
bytes32 The 32-byte EIP-712 domain separator value as a bytes32 hash.✨ AI
getAttestationSigner(account: address) view

Returns the attestation signer for the specified account.

參數

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

回傳值

名稱 類型 描述
address The address with which the account can sign attestations.
getDataEncryptionKey(account: address) view

Getter for the data encryption key and version.

參數

名稱 類型 描述
account address The address of the account to get the key for

回傳值

名稱 類型 描述
bytes dataEncryptionKey secp256k1 public key for data encryption. Preferably compressed.
getDefaultSigner(account: address, role: bytes32) view

Returns the default signer for the specified account and role. If no signer has been specified it will return the account itself.

參數

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

回傳值

名稱 類型 描述
address
getIndexedSigner(account: address, role: bytes32) view

Returns the indexed signer for the specified account and role. If no signer has been specified it will return the account itself.

參數

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

回傳值

名稱 類型 描述
address
getLegacySigner(_account: address, role: bytes32) view

Returns the legacy signer for the specified account and role. If no signer has been specified it will return the account itself.

參數

名稱 類型 描述
_account address The address of the account.
role bytes32 The role of the signer.

回傳值

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

Getter for the metadata of an account.

參數

名稱 類型 描述
account address The address of the account to get the metadata for.

回傳值

名稱 類型 描述
string metadataURL The URL to access the metadata.
getName(account: address) view

Getter for the name of an account.

參數

名稱 類型 描述
account address The address of the account to get the name for.

回傳值

名稱 類型 描述
string name The name of the account.
getOffchainStorageRoots(account: address) view

Returns the full list of offchain storage roots for an account.

參數

名稱 類型 描述
account address The account whose storage roots to return.

回傳值

名稱 類型 描述
bytes Concatenated storage root URLs.
uint256[] Lengths of storage root URLs.
getPaymentDelegation(account: address) view

Gets validator payment delegation settings.

參數

名稱 類型 描述
account address Account of the validator.

回傳值

名稱 類型 描述
address Beneficiary address of payment delegated.
uint256 Fraction of payment delegated.
getRoleAuthorizationSigner(account: address, signer: address, role: bytes32, v: uint8, r: bytes32, s: bytes32) view

Returns the address that signed the provided role authorization.

參數

名稱 類型 描述
account address The `account` property signed over in the EIP712 signature
signer address The `signer` property signed over in the EIP712 signature
role bytes32 The `role` property signed over in the EIP712 signature
v uint8 The recovery id of the incoming ECDSA signature.
r bytes32 Output value r of the ECDSA signature.
s bytes32 Output value s of the ECDSA signature.

回傳值

名稱 類型 描述
address The address that signed the provided role authorization.
getValidatorSigner(account: address) view

Returns the validator signer for the specified account.

參數

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

回傳值

名稱 類型 描述
address The address with which the account can register a validator or group.
getVersionNumber() pure

Returns the storage, major, minor, and patch version of the contract.

回傳值

名稱 類型 描述
uint256 Storage version of the contract.
uint256 Major version of the contract.
uint256 Minor version of the contract.
uint256 Patch version of the contract.
getVoteSigner(account: address) view

Returns the vote signer for the specified account.

參數

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

回傳值

名稱 類型 描述
address The address with which the account can sign votes.
getWalletAddress(account: address) view

Getter for the wallet address for an account

參數

名稱 類型 描述
account address The address of the account to get the wallet address for

回傳值

名稱 類型 描述
address Wallet address
hasAuthorizedAttestationSigner(account: address) view

Returns if account has specified a dedicated attestation signer.

參數

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

回傳值

名稱 類型 描述
bool Whether the account has specified a dedicated attestation signer.
hasAuthorizedSigner(account: address, role: string) view

Checks whether or not the account has a signer registered for the plaintext role.

開發者: See `hasIndexedSigner` for more gas efficient call.

參數

名稱 類型 描述
account address
role string

回傳值

名稱 類型 描述
bool
hasAuthorizedValidatorSigner(account: address) view

Returns if account has specified a dedicated validator signer.

參數

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

回傳值

名稱 類型 描述
bool Whether the account has specified a dedicated validator signer.
hasAuthorizedVoteSigner(account: address) view

Returns if account has specified a dedicated vote signer.

參數

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

回傳值

名稱 類型 描述
bool Whether the account has specified a dedicated vote signer.
hasDefaultSigner(account: address, role: bytes32) view

Checks whether or not the account has an indexed signer registered for a role

參數

名稱 類型 描述
account address
role bytes32

回傳值

名稱 類型 描述
bool
hasIndexedSigner(account: address, role: bytes32) view

Checks whether or not the account has an indexed signer registered for the role

參數

名稱 類型 描述
account address
role bytes32

回傳值

名稱 類型 描述
bool
hasLegacySigner(account: address, role: bytes32) view

Checks whether or not the account has an indexed signer registered for one of the legacy roles

參數

名稱 類型 描述
account address
role bytes32

回傳值

名稱 類型 描述
bool
initialized() view

Checks whether the Accounts contract has completed its initialization.✨ AI

回傳值

名稱 類型 描述
bool True if the contract has been initialized, false otherwise.✨ AI
isAccount(account: address) view

Check if an account already exists.

參數

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

回傳值

名稱 類型 描述
bool Returns `true` if account exists. Returns `false` otherwise.
isAuthorizedSigner(signer: address) view

Check if an address has been an authorized signer for an account.

參數

名稱 類型 描述
signer address The possibly authorized address.

回傳值

名稱 類型 描述
bool Returns `true` if authorized. Returns `false` otherwise.
isDefaultSigner(account: address, signer: address, role: bytes32) view

Whether or not the signer has been registered as the default signer for role

參數

名稱 類型 描述
account address The address of account that authorized signing.
signer address The address of the signer.
role bytes32 The role that has been authorized.

回傳值

名稱 類型 描述
bool
isIndexedSigner(account: address, signer: address, role: bytes32) view

Whether or not the signer has been registered as an indexed signer for role

參數

名稱 類型 描述
account address The address of account that authorized signing.
signer address The address of the signer.
role bytes32 The role that has been authorized.

回傳值

名稱 類型 描述
bool
isLegacyRole(role: bytes32) pure

Checks whether the role is one of Vote, Validator or Attestation

參數

名稱 類型 描述
role bytes32 The role to check

回傳值

名稱 類型 描述
bool
isLegacySigner(_account: address, signer: address, role: bytes32) view

Whether or not the signer has been registered as the legacy signer for role

參數

名稱 類型 描述
_account address The address of account that authorized signing.
signer address The address of the signer.
role bytes32 The role that has been authorized.

回傳值

名稱 類型 描述
bool
isOwner() view

Return whether the caller is an owner of the contract.✨ AI

開發者: Returns true if the caller is the current owner.

回傳值

名稱 類型 描述
bool True if the caller is an owner of the contract; false otherwise.✨ AI
isSigner(account: address, signer: address, role: bytes32) view

Whether or not the signer has been registered as a signer for role

參數

名稱 類型 描述
account address The address of account that authorized signing.
signer address The address of the signer.
role bytes32 The role that has been authorized.

回傳值

名稱 類型 描述
bool
offchainStorageRoots(address, uint256) view

Return the off-chain storage root for a given account at a specified index.✨ AI

參數

名稱 類型 描述
address
uint256

回傳值

名稱 類型 描述
bytes Raw bytes containing the off-chain storage root for the specified account and index.✨ AI
owner() view

Returns the address of the account that currently owns or administers this contract.✨ AI

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

回傳值

名稱 類型 描述
address The owner's Ethereum address used for authorization and administrative actions.✨ AI
registry() view

Returns the address of the registry associated with this Accounts contract.✨ AI

回傳值

名稱 類型 描述
address The address of the registry contract used by this Accounts contract.✨ AI
signerToAccount(signer: address) view

Returns the account associated with `signer`.

開發者: Fails if the `signer` is not an account or previously authorized signer.

參數

名稱 類型 描述
signer address The address of the account or previously authorized signer.

回傳值

名稱 類型 描述
address The associated account.
validatorSignerToAccount(signer: address) view

Returns the account associated with `signer`.

開發者: Fails if the `signer` is not an account or currently authorized validator.

參數

名稱 類型 描述
signer address The address of an account or currently authorized validator signer.

回傳值

名稱 類型 描述
address The associated account that signer is authorized to validate for.
voteSignerToAccount(signer: address) view

Returns the account associated with `signer`.

開發者: Fails if the `signer` is not an account or currently authorized vote signer.

參數

名稱 類型 描述
signer address The address of the account or currently authorized vote signer.

回傳值

名稱 類型 描述
address The associated account that signer is authorized to vote for.

寫入函式

addStorageRoot(url: bytes) nonpayable

Adds a new CIP8 storage root.

參數

名稱 類型 描述
url bytes The URL pointing to the offchain storage root.
authorizeAttestationSigner(signer: address, v: uint8, r: bytes32, s: bytes32) nonpayable

Authorizes an address to sign attestations on behalf of the account.

開發者: v, r, s constitute `signer`'s signature on `msg.sender`.

參數

名稱 類型 描述
signer address The address of the signing key to authorize.
v uint8 The recovery id of the incoming ECDSA signature.
r bytes32 Output value r of the ECDSA signature.
s bytes32 Output value s of the ECDSA signature.
authorizeSigner(signer: address, role: bytes32) nonpayable

Begin the process of authorizing an address to sign on behalf of the account

參數

名稱 類型 描述
signer address The address of the signing key to authorize.
role bytes32 The role to authorize signing for.
authorizeSignerWithSignature(signer: address, role: bytes32, v: uint8, r: bytes32, s: bytes32) nonpayable

Authorizes an address to act as a signer, for `role`, on behalf of the account.

開發者: v, r, s constitute `signer`'s EIP712 signature over `role`, `msg.sender` and `signer`.

參數

名稱 類型 描述
signer address The address of the signing key to authorize.
role bytes32 The role to authorize signing for.
v uint8 The recovery id of the incoming ECDSA signature.
r bytes32 Output value r of the ECDSA signature.
s bytes32 Output value s of the ECDSA signature.
authorizeValidatorSigner(signer: address, v: uint8, r: bytes32, s: bytes32) nonpayable

Authorizes an address to sign consensus messages on behalf of the account.

開發者: v, r, s constitute `signer`'s signature on `msg.sender`.

參數

名稱 類型 描述
signer address The address of the signing key to authorize.
v uint8 The recovery id of the incoming ECDSA signature.
r bytes32 Output value r of the ECDSA signature.
s bytes32 Output value s of the ECDSA signature.
authorizeValidatorSignerWithPublicKey(signer: address, v: uint8, r: bytes32, s: bytes32, ecdsaPublicKey: bytes) nonpayable

Authorizes an address to sign consensus messages on behalf of the account.

開發者: v, r, s constitute `signer`'s signature on `msg.sender`.

參數

名稱 類型 描述
signer address The address of the signing key to authorize.
v uint8 The recovery id of the incoming ECDSA signature.
r bytes32 Output value r of the ECDSA signature.
s bytes32 Output value s of the ECDSA signature.
ecdsaPublicKey bytes The ECDSA public key corresponding to `signer`.
authorizeVoteSigner(signer: address, v: uint8, r: bytes32, s: bytes32) nonpayable

Authorizes an address to sign votes on behalf of the account.

開發者: v, r, s constitute `signer`'s signature on `msg.sender`.

參數

名稱 類型 描述
signer address The address of the signing key to authorize.
v uint8 The recovery id of the incoming ECDSA signature.
r bytes32 Output value r of the ECDSA signature.
s bytes32 Output value s of the ECDSA signature.
completeSignerAuthorization(account: address, role: bytes32) nonpayable

Finish the process of authorizing an address to sign on behalf of the account.

參數

名稱 類型 描述
account address The address of account that authorized signing.
role bytes32 The role to finish authorizing for.
createAccount() nonpayable

Creates an account.

回傳值

名稱 類型 描述
bool True if account creation succeeded.
deletePaymentDelegation() nonpayable

Removes a validator's payment delegation by setting benficiary and fraction to 0.

initialize(registryAddress: address) nonpayable

Used in place of the constructor to allow the contract to be upgradable via proxy.

參數

名稱 類型 描述
registryAddress address The address of the registry core smart contract.
removeAttestationSigner() nonpayable

Removes the currently authorized attestation signer for the account Note that the signers cannot be reauthorized after they have been removed.

removeDefaultSigner(role: bytes32) nonpayable

Removes the signer for a default role.

參數

名稱 類型 描述
role bytes32 The role that has been authorized.
removeIndexedSigner(role: bytes32) nonpayable

Removes the currently authorized and indexed signer for a specific role

參數

名稱 類型 描述
role bytes32 The role of the signer.
removeSigner(signer: address, role: bytes32) nonpayable

Removes the currently authorized signer for a specific role and if the signer is indexed, remove that as well.

參數

名稱 類型 描述
signer address The address of the signer.
role bytes32 The role that has been authorized.
removeStorageRoot(index: uint256) nonpayable

Removes a CIP8 storage root.

開發者: The order of storage roots may change after this operation (the last storage root will be moved to `index`), be aware of this if removing multiple storage roots at a time.

參數

名稱 類型 描述
index uint256 The index of the storage root to be removed in the account's list of storage roots.
removeValidatorSigner() nonpayable

Removes the currently authorized validator signer for the account Note that the signers cannot be reauthorized after they have been removed.

removeVoteSigner() nonpayable

Removes the currently authorized vote signer for the account. Note that the signers cannot be reauthorized after they have been removed.

renounceOwnership() nonpayable

Allows the current owner to renounce ownership, leaving the contract without an owner.✨ AI

開發者: Leaves the contract without owner. It will not be possible to call `onlyOwner` functions anymore. Can only be called by the current owner. NOTE: Renouncing ownership will leave the contract without an owner, thereby removing any functionality that is only available to the owner.
setAccount(name: string, dataEncryptionKey: bytes, walletAddress: address, v: uint8, r: bytes32, s: bytes32) nonpayable

Convenience Setter for the dataEncryptionKey and wallet address for an account

開發者: v, r, s constitute `signer`'s signature on `msg.sender` (unless the wallet address is 0x0 or msg.sender).

參數

名稱 類型 描述
name string A string to set as the name of the account
dataEncryptionKey bytes secp256k1 public key for data encryption. Preferably compressed.
walletAddress address The wallet address to set for the account
v uint8 The recovery id of the incoming ECDSA signature.
r bytes32 Output value r of the ECDSA signature.
s bytes32 Output value s of the ECDSA signature.
setAccountDataEncryptionKey(dataEncryptionKey: bytes) nonpayable

Setter for the data encryption key and version.

參數

名稱 類型 描述
dataEncryptionKey bytes secp256k1 public key for data encryption. Preferably compressed.
setEip712DomainSeparator() nonpayable

Sets the EIP712 domain separator for the Celo Accounts abstraction.

setIndexedSigner(signer: address, role: bytes32) nonpayable

Set the indexed signer for a specific role

參數

名稱 類型 描述
signer address the address to set as default
role bytes32 the role to register a default signer for
setMetadataURL(metadataURL: string) nonpayable

Setter for the metadata of an account.

參數

名稱 類型 描述
metadataURL string The URL to access the metadata.
setName(name: string) nonpayable

Setter for the name of an account.

參數

名稱 類型 描述
name string The name to set.
setPaymentDelegation(beneficiary: address, fraction: uint256) nonpayable

Sets validator payment delegation settings.

開發者: Use `deletePaymentDelegation` to unset the payment delegation.

參數

名稱 類型 描述
beneficiary address The address that should receive a portion of validator payments.
fraction uint256 The fraction of the validator's payment that should be diverted to `beneficiary` every epoch, given as FixidityLib value. Must not be greater than 1.
setRegistry(registryAddress: address) nonpayable

Updates the address pointing to a Registry contract.

參數

名稱 類型 描述
registryAddress address The address of a registry contract for routing to other contracts.
setWalletAddress(walletAddress: address, v: uint8, r: bytes32, s: bytes32) nonpayable

Setter for the wallet address for an account

開發者: v, r, s constitute `signer`'s signature on `msg.sender` (unless the wallet address is 0x0 or msg.sender).

參數

名稱 類型 描述
walletAddress address The wallet address to set for the account
v uint8 The recovery id of the incoming ECDSA signature.
r bytes32 Output value r of the ECDSA signature.
s bytes32 Output value s of the ECDSA signature.
transferOwnership(newOwner: address) nonpayable

Transfers contract ownership to the specified 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 owner of the contract.✨ AI

事件

AccountCreated(account: address)
名稱 類型 已索引 描述
account address
AccountDataEncryptionKeySet(account: address, dataEncryptionKey: bytes)
名稱 類型 已索引 描述
account address
dataEncryptionKey bytes
AccountMetadataURLSet(account: address, metadataURL: string)
名稱 類型 已索引 描述
account address
metadataURL string
AccountNameSet(account: address, name: string)
名稱 類型 已索引 描述
account address
name string
AccountWalletAddressSet(account: address, walletAddress: address)
名稱 類型 已索引 描述
account address
walletAddress address
AttestationSignerAuthorized(account: address, signer: address)
名稱 類型 已索引 描述
account address
signer address
AttestationSignerRemoved(account: address, oldSigner: address)
名稱 類型 已索引 描述
account address
oldSigner address
DefaultSignerRemoved(account: address, oldSigner: address, role: bytes32)
名稱 類型 已索引 描述
account address
oldSigner address
role bytes32
DefaultSignerSet(account: address, signer: address, role: bytes32)
名稱 類型 已索引 描述
account address
signer address
role bytes32
IndexedSignerRemoved(account: address, oldSigner: address, role: bytes32)
名稱 類型 已索引 描述
account address
oldSigner address
role bytes32
IndexedSignerSet(account: address, signer: address, role: bytes32)
名稱 類型 已索引 描述
account address
signer address
role bytes32
LegacySignerRemoved(account: address, oldSigner: address, role: bytes32)
名稱 類型 已索引 描述
account address
oldSigner address
role bytes32
LegacySignerSet(account: address, signer: address, role: bytes32)
名稱 類型 已索引 描述
account address
signer address
role bytes32
OffchainStorageRootAdded(account: address, url: bytes)
名稱 類型 已索引 描述
account address
url bytes
OffchainStorageRootRemoved(account: address, url: bytes, index: uint256)
名稱 類型 已索引 描述
account address
url bytes
index uint256
OwnershipTransferred(previousOwner: address, newOwner: address)
名稱 類型 已索引 描述
previousOwner address
newOwner address
PaymentDelegationSet(beneficiary: address, fraction: uint256)
名稱 類型 已索引 描述
beneficiary address
fraction uint256
RegistrySet(registryAddress: address)
名稱 類型 已索引 描述
registryAddress address
SignerAuthorizationCompleted(account: address, signer: address, role: bytes32)
名稱 類型 已索引 描述
account address
signer address
role bytes32
SignerAuthorizationStarted(account: address, signer: address, role: bytes32)
名稱 類型 已索引 描述
account address
signer address
role bytes32
SignerAuthorized(account: address, signer: address, role: bytes32)
名稱 類型 已索引 描述
account address
signer address
role bytes32
SignerRemoved(account: address, oldSigner: address, role: bytes32)
名稱 類型 已索引 描述
account address
oldSigner address
role bytes32
ValidatorSignerAuthorized(account: address, signer: address)
名稱 類型 已索引 描述
account address
signer address
ValidatorSignerRemoved(account: address, oldSigner: address)
名稱 類型 已索引 描述
account address
oldSigner address
VoteSignerAuthorized(account: address, signer: address)
名稱 類型 已索引 描述
account address
signer address
VoteSignerRemoved(account: address, oldSigner: address)
名稱 類型 已索引 描述
account address
oldSigner address