SKALE Chain Access Control
SKALE Chains have several ways to manage access control, meaning who is capable of sending a transaction to the SKALE Chain or who is capable of deploying new contracts. There are several methods to manage access: distribution of sFUEL to SKALE Chain users and the ConfigController contract, which authorizes specific contracts to deploy new contracts and enables Free Contract Deployment. The next paragraph will describe the listed methods.
Config Controller
New SKALE Chains are set only to allow the SKALE Chain owner and CREATE/CREATE2 opcodes the ability to deploy new contracts. Other addresses can be permitted on the fly to deploy contracts by whitelisting addresses.
The predeployed ConfigController contract’s address is 0xD2002000000000000000000000000000000000D2
and contains several settings covered below:
Free Contract Deployment
-
Allows any account to deploy contracts on the SKALE Chain. Also, you must be assigned as
DEPLOYER_ADMIN_ROLE
- only in this way can you run these methods. You can configure your own SKALE Chain to enable/disable this mode.enableFreeContractDeployment()
- enables Free Contract DeploymentdisableFreeContractDeployment()
- disables Free Contract Deployment
Whitelist
-
A list of accounts that are allowed to deploy contracts. The whitelist is enabled automatically when Free Contract Deployment is disabled. Also, you must be assigned as
DEPLOYER_ADMIN_ROLE
or SKALE Chain owner to add an account to the whitelist, which means that account will be assigned as aDEPLOYER_ROLE
.addToWhitelist(address addr)
- adds accounts that are allowed to deploy contractsremoveFromWhitelist(address addr)
- removes accounts that are allowed to deploy contracts
SKALE FUEL (sFUEL)
The SKALE Chain owner (coinbase address) is the only account allocated sFUEL when the SKALE Chain is created (if using the SDK, you can add additional allocations during setup). The owner account is therefore responsible for distributing sFUEL to users.
The total amount of sFUEL allocation is set in the genesis block of each SKALE Chain and therefore can’t be changed once a chain is deployed.
SKALE Chain owners can apply a variety of methods to distribute sFUEL to users:
- Direct transaction from the owner to an address
- Sending an allocation of sFUEL to a SKALE Chain contract, which applies some logic to distribute sFUEL to an address.
When addresses use sFUEL to perform transactions, the sFUEL fee used to conduct the transaction is recirculated back to the coinbase address.