Accounts

Celo

0x7d21685c17607338b313a7174bab6620bad0aab7

Proxy implementation: 0x907f5c53c0e31db06af45bc58f076563469c525a

Solidity v0.5.13+commit.5b0b510c

🤖
Query this contract from your AI
Reference: 0x7d21685c17607338b313a7174bab6620bad0aab7
Sample prompt: "Tell me the current state of celo/0x7d21685c17607338b313a7174bab6620bad0aab7"
No AI wired up yet? → mcp.smarts.md
Celo is a docs-only chain on Smarts: source code and ABI are indexed, but live on-chain data (state, recent events, admin profile) is not currently available. AI agents can still query get_contract_info and get_contract_source via MCP.

Overview

Read Functions
41
Write Functions
29
Events
26

Read Functions

EIP712_AUTHORIZE_SIGNER_TYPEHASH() view

Returns

Name Type Description
bytes32
attestationSignerToAccount(signer: address) view

Returns the account associated with `signer`.

dev: Fails if the `signer` is not an account or currently authorized attestation signer.

Parameters

Name Type Description
signer address The address of the account or currently authorized attestation signer.

Returns

Name Type Description
address The associated account that the signer is authorized to attest for.
authorizedBy(address) view

Parameters

Name Type Description
address

Returns

Name Type Description
address
batchGetMetadataURL(accountsToQuery: address[]) view

Getter for the metadata of multiple accounts.

Parameters

Name Type Description
accountsToQuery address[] The addresses of the accounts to get the metadata for.

Returns

Name Type Description
uint256[] The length of each string in bytes.
bytes All strings concatenated.
eip712DomainSeparator() view

Returns

Name Type Description
bytes32
getAttestationSigner(account: address) view

Returns the attestation signer for the specified account.

Parameters

Name Type Description
account address The address of the account.

Returns

Name Type Description
address The address with which the account can sign attestations.
getDataEncryptionKey(account: address) view

Getter for the data encryption key and version.

Parameters

Name Type Description
account address The address of the account to get the key for

Returns

Name Type Description
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.

Parameters

Name Type Description
account address The address of the account.
role bytes32 The role of the signer.

Returns

Name Type Description
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.

Parameters

Name Type Description
account address The address of the account.
role bytes32 The role of the signer.

Returns

Name Type Description
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.

Parameters

Name Type Description
_account address The address of the account.
role bytes32 The role of the signer.

Returns

Name Type Description
address
getMetadataURL(account: address) view

Getter for the metadata of an account.

Parameters

Name Type Description
account address The address of the account to get the metadata for.

Returns

Name Type Description
string metadataURL The URL to access the metadata.
getName(account: address) view

Getter for the name of an account.

Parameters

Name Type Description
account address The address of the account to get the name for.

Returns

Name Type Description
string name The name of the account.
getOffchainStorageRoots(account: address) view

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

Parameters

Name Type Description
account address The account whose storage roots to return.

Returns

Name Type Description
bytes Concatenated storage root URLs.
uint256[] Lengths of storage root URLs.
getPaymentDelegation(account: address) view

Gets validator payment delegation settings.

Parameters

Name Type Description
account address Account of the validator.

Returns

Name Type Description
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.

Parameters

Name Type Description
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.

Returns

Name Type Description
address The address that signed the provided role authorization.
getValidatorSigner(account: address) view

Returns the validator signer for the specified account.

Parameters

Name Type Description
account address The address of the account.

Returns

Name Type Description
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.

Returns

Name Type Description
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.

Parameters

Name Type Description
account address The address of the account.

Returns

Name Type Description
address The address with which the account can sign votes.
getWalletAddress(account: address) view

Getter for the wallet address for an account

Parameters

Name Type Description
account address The address of the account to get the wallet address for

Returns

Name Type Description
address Wallet address
hasAuthorizedAttestationSigner(account: address) view

Returns if account has specified a dedicated attestation signer.

Parameters

Name Type Description
account address The address of the account.

Returns

Name Type Description
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.

dev: See `hasIndexedSigner` for more gas efficient call.

Parameters

Name Type Description
account address
role string

Returns

Name Type Description
bool
hasAuthorizedValidatorSigner(account: address) view

Returns if account has specified a dedicated validator signer.

Parameters

Name Type Description
account address The address of the account.

Returns

Name Type Description
bool Whether the account has specified a dedicated validator signer.
hasAuthorizedVoteSigner(account: address) view

Returns if account has specified a dedicated vote signer.

Parameters

Name Type Description
account address The address of the account.

Returns

Name Type Description
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

Parameters

Name Type Description
account address
role bytes32

Returns

Name Type Description
bool
hasIndexedSigner(account: address, role: bytes32) view

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

Parameters

Name Type Description
account address
role bytes32

Returns

Name Type Description
bool
hasLegacySigner(account: address, role: bytes32) view

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

Parameters

Name Type Description
account address
role bytes32

Returns

Name Type Description
bool
initialized() view

Returns

Name Type Description
bool
isAccount(account: address) view

Check if an account already exists.

Parameters

Name Type Description
account address The address of the account

Returns

Name Type Description
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.

Parameters

Name Type Description
signer address The possibly authorized address.

Returns

Name Type Description
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

Parameters

Name Type Description
account address The address of account that authorized signing.
signer address The address of the signer.
role bytes32 The role that has been authorized.

Returns

Name Type Description
bool
isIndexedSigner(account: address, signer: address, role: bytes32) view

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

Parameters

Name Type Description
account address The address of account that authorized signing.
signer address The address of the signer.
role bytes32 The role that has been authorized.

Returns

Name Type Description
bool
isLegacyRole(role: bytes32) pure

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

Parameters

Name Type Description
role bytes32 The role to check

Returns

Name Type Description
bool
isLegacySigner(_account: address, signer: address, role: bytes32) view

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

Parameters

Name Type Description
_account address The address of account that authorized signing.
signer address The address of the signer.
role bytes32 The role that has been authorized.

Returns

Name Type Description
bool
isOwner() view
dev: Returns true if the caller is the current owner.

Returns

Name Type Description
bool
isSigner(account: address, signer: address, role: bytes32) view

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

Parameters

Name Type Description
account address The address of account that authorized signing.
signer address The address of the signer.
role bytes32 The role that has been authorized.

Returns

Name Type Description
bool
offchainStorageRoots(address, uint256) view

Parameters

Name Type Description
address
uint256

Returns

Name Type Description
bytes
owner() view
dev: Returns the address of the current owner.

Returns

Name Type Description
address
registry() view

Returns

Name Type Description
address
signerToAccount(signer: address) view

Returns the account associated with `signer`.

dev: Fails if the `signer` is not an account or previously authorized signer.

Parameters

Name Type Description
signer address The address of the account or previously authorized signer.

Returns

Name Type Description
address The associated account.
validatorSignerToAccount(signer: address) view

Returns the account associated with `signer`.

dev: Fails if the `signer` is not an account or currently authorized validator.

Parameters

Name Type Description
signer address The address of an account or currently authorized validator signer.

Returns

Name Type Description
address The associated account that signer is authorized to validate for.
voteSignerToAccount(signer: address) view

Returns the account associated with `signer`.

dev: Fails if the `signer` is not an account or currently authorized vote signer.

Parameters

Name Type Description
signer address The address of the account or currently authorized vote signer.

Returns

Name Type Description
address The associated account that signer is authorized to vote for.

Write Functions

addStorageRoot(url: bytes) nonpayable

Adds a new CIP8 storage root.

Parameters

Name Type Description
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.

dev: v, r, s constitute `signer`'s signature on `msg.sender`.

Parameters

Name Type Description
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

Parameters

Name Type Description
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.

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

Parameters

Name Type Description
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.

dev: v, r, s constitute `signer`'s signature on `msg.sender`.

Parameters

Name Type Description
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.

dev: v, r, s constitute `signer`'s signature on `msg.sender`.

Parameters

Name Type Description
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.

dev: v, r, s constitute `signer`'s signature on `msg.sender`.

Parameters

Name Type Description
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.

Parameters

Name Type Description
account address The address of account that authorized signing.
role bytes32 The role to finish authorizing for.
createAccount() nonpayable

Creates an account.

Returns

Name Type Description
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.

Parameters

Name Type Description
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.

Parameters

Name Type Description
role bytes32 The role that has been authorized.
removeIndexedSigner(role: bytes32) nonpayable

Removes the currently authorized and indexed signer for a specific role

Parameters

Name Type Description
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.

Parameters

Name Type Description
signer address The address of the signer.
role bytes32 The role that has been authorized.
removeStorageRoot(index: uint256) nonpayable

Removes a CIP8 storage root.

dev: 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.

Parameters

Name Type Description
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
dev: 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

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

Parameters

Name Type Description
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.

Parameters

Name Type Description
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

Parameters

Name Type Description
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.

Parameters

Name Type Description
metadataURL string The URL to access the metadata.
setName(name: string) nonpayable

Setter for the name of an account.

Parameters

Name Type Description
name string The name to set.
setPaymentDelegation(beneficiary: address, fraction: uint256) nonpayable

Sets validator payment delegation settings.

dev: Use `deletePaymentDelegation` to unset the payment delegation.

Parameters

Name Type Description
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.

Parameters

Name Type Description
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

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

Parameters

Name Type Description
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
dev: Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.

Parameters

Name Type Description
newOwner address

Events

AccountCreated(account: address)
Name Type Indexed Description
account address
AccountDataEncryptionKeySet(account: address, dataEncryptionKey: bytes)
Name Type Indexed Description
account address
dataEncryptionKey bytes
AccountMetadataURLSet(account: address, metadataURL: string)
Name Type Indexed Description
account address
metadataURL string
AccountNameSet(account: address, name: string)
Name Type Indexed Description
account address
name string
AccountWalletAddressSet(account: address, walletAddress: address)
Name Type Indexed Description
account address
walletAddress address
AttestationSignerAuthorized(account: address, signer: address)
Name Type Indexed Description
account address
signer address
AttestationSignerRemoved(account: address, oldSigner: address)
Name Type Indexed Description
account address
oldSigner address
DefaultSignerRemoved(account: address, oldSigner: address, role: bytes32)
Name Type Indexed Description
account address
oldSigner address
role bytes32
DefaultSignerSet(account: address, signer: address, role: bytes32)
Name Type Indexed Description
account address
signer address
role bytes32
IndexedSignerRemoved(account: address, oldSigner: address, role: bytes32)
Name Type Indexed Description
account address
oldSigner address
role bytes32
IndexedSignerSet(account: address, signer: address, role: bytes32)
Name Type Indexed Description
account address
signer address
role bytes32
LegacySignerRemoved(account: address, oldSigner: address, role: bytes32)
Name Type Indexed Description
account address
oldSigner address
role bytes32
LegacySignerSet(account: address, signer: address, role: bytes32)
Name Type Indexed Description
account address
signer address
role bytes32
OffchainStorageRootAdded(account: address, url: bytes)
Name Type Indexed Description
account address
url bytes
OffchainStorageRootRemoved(account: address, url: bytes, index: uint256)
Name Type Indexed Description
account address
url bytes
index uint256
OwnershipTransferred(previousOwner: address, newOwner: address)
Name Type Indexed Description
previousOwner address
newOwner address
PaymentDelegationSet(beneficiary: address, fraction: uint256)
Name Type Indexed Description
beneficiary address
fraction uint256
RegistrySet(registryAddress: address)
Name Type Indexed Description
registryAddress address
SignerAuthorizationCompleted(account: address, signer: address, role: bytes32)
Name Type Indexed Description
account address
signer address
role bytes32
SignerAuthorizationStarted(account: address, signer: address, role: bytes32)
Name Type Indexed Description
account address
signer address
role bytes32
SignerAuthorized(account: address, signer: address, role: bytes32)
Name Type Indexed Description
account address
signer address
role bytes32
SignerRemoved(account: address, oldSigner: address, role: bytes32)
Name Type Indexed Description
account address
oldSigner address
role bytes32
ValidatorSignerAuthorized(account: address, signer: address)
Name Type Indexed Description
account address
signer address
ValidatorSignerRemoved(account: address, oldSigner: address)
Name Type Indexed Description
account address
oldSigner address
VoteSignerAuthorized(account: address, signer: address)
Name Type Indexed Description
account address
signer address
VoteSignerRemoved(account: address, oldSigner: address)
Name Type Indexed Description
account address
oldSigner address