cairo-account
Generate custom smart contracts for Starknet or Ethereum-style accounts with configurable features like upgradeability, deployment, and signature types using OpenZeppelin Contracts libraries.
Instructions
Make a custom smart contract that represents an account that can be deployed and interacted with other contracts, and can be extended to implement custom logic. An account is a special type of contract that is used to validate and execute transactions.
Returns the source code of the generated contract, formatted in a Markdown code block. Does not write to disk.
Input Schema
Name | Required | Description | Default |
---|---|---|---|
declare | No | Whether to enable the account to declare other contract classes. | |
deploy | No | Whether to enables the account to be counterfactually deployed. | |
info | No | Metadata about the contract and author | |
name | Yes | The name of the contract | |
outsideExecution | No | Whether to allow a protocol to submit transactions on behalf of the account, as long as it has the relevant signatures. | |
pubkey | No | Whether to enables the account to change its own public key. | |
type | Yes | Type of signature used for signature checking by the Account contract, Starknet account uses the STARK curve, Ethereum-flavored account uses the Secp256k1 curve. | |
upgradeable | No | Whether the smart contract is upgradeable. |
Input Schema (JSON Schema)
{
"$schema": "http://json-schema.org/draft-07/schema#",
"additionalProperties": false,
"properties": {
"declare": {
"description": "Whether to enable the account to declare other contract classes.",
"type": "boolean"
},
"deploy": {
"description": "Whether to enables the account to be counterfactually deployed.",
"type": "boolean"
},
"info": {
"additionalProperties": false,
"description": "Metadata about the contract and author",
"properties": {
"license": {
"description": "The license used by the contract, default is \"MIT\"",
"type": "string"
},
"securityContact": {
"description": "Email where people can contact you to report security issues. Will only be visible if contract source code is verified.",
"type": "string"
}
},
"type": "object"
},
"name": {
"description": "The name of the contract",
"type": "string"
},
"outsideExecution": {
"description": "Whether to allow a protocol to submit transactions on behalf of the account, as long as it has the relevant signatures.",
"type": "boolean"
},
"pubkey": {
"description": "Whether to enables the account to change its own public key.",
"type": "boolean"
},
"type": {
"description": "Type of signature used for signature checking by the Account contract, Starknet account uses the STARK curve, Ethereum-flavored account uses the Secp256k1 curve.",
"enum": [
"stark",
"eth"
],
"type": "string"
},
"upgradeable": {
"description": "Whether the smart contract is upgradeable.",
"type": "boolean"
}
},
"required": [
"name",
"type"
],
"type": "object"
}