The access control of your contract is an important concept that governs many features provided by your smart contract.
Almost every smart contract must have an access control mechanism. We provide two:
Ownership
Role-Based Access Control
"Ownership" is a simple approach to set up access control within your smart contract. You can easily provide the "accessControl" property with "OWNABLE" during deployment to get started. Thereby, the restricted areas of the contract can only be called by the owner of the contract.
Path parameter:
chain
: chain to work with.
Main chains: ETHEREUM, POLYGON
Testnet chains: RINKEBY, ROPSTEN, MUMBAI, SHIMMEREVM
contract
: smart contract address
Path parameter:
chain
: chain to work with.
Main chains: ETHEREUM, POLYGON
Testnet chains: RINKEBY, ROPSTEN, MUMBAI, SHIMMEREVM
contract
: smart contract address
account
: [string] the new owner address.
Path parameter:
chain
: chain to work with.
Main chains: ETHEREUM, POLYGON
Testnet chains: RINKEBY, ROPSTEN, MUMBAI, SHIMMEREVM
contract
: smart contract address
"Role-Based Access Control" is a more complex approach than "Ownership" to manage access control. With this approach, you can define a hierarchy of roles, each allowed to perform a different set of actions. You can also assign multiple accounts to each role.
Path parameter:
chain
: chain to work with.
Main chains: ETHEREUM, POLYGON
Testnet chains: RINKEBY, ROPSTEN, MUMBAI, SHIMMEREVM
contract
: smart contract address
account
: an account address
role
: role name
Path parameter:
chain
: chain to work with.
Main chains: ETHEREUM, POLYGON
Testnet chains: RINKEBY, ROPSTEN, MUMBAI, SHIMMEREVM
contract
: smart contract address
role
: role name
Path parameter:
chain
: chain to work with.
Main chains: ETHEREUM, POLYGON
Testnet chains: RINKEBY, ROPSTEN, MUMBAI, SHIMMEREVM
contract
: smart contract address
role
: [string] the role you want to grant to the specified account.
account
: [string] an account address.
Path parameter:
chain
: chain to work with.
Main chains: ETHEREUM, POLYGON
Testnet chains: SEPOLIA, GOERLI, MUMBAI, SHIMMEREVM
contract
: smart contract address
role
: [string] the role you want to revoke from the specified account.
account
: [string] an account address.
Path parameter:
chain
: chain to work with.
Main chains: ETHEREUM, POLYGON
Testnet chains: SEPOLIA, GOERLI, MUMBAI, SHIMMEREVM
contract
: smart contract address
role
: [string] the role you want to renounce from the specified account.
account
: [string] an account address.