Solidity API
Permit69
Permit69 manages ERC20 approvals and transfers between Atlas and Execution Environment contracts during metacall transactions.
constructor
constructor(uint256 escrowDuration, uint256 atlasSurchargeRate, uint256 bundlerSurchargeRate, address verification, address simulator, address initialSurchargeRecipient, address l2GasCalculator) internal
_verifyUserControlExecutionEnv
function _verifyUserControlExecutionEnv(address environment, address user, address control, uint32 callConfig) internal virtual returns (bool)
Verifies that the caller is an authorized Execution Environment contract.
This function is called internally to ensure that the caller is a legitimate Execution Environment contract controlled by the current DAppControl contract. It helps prevent unauthorized access and ensures that token transfers are performed within the context of Atlas's controlled environment. The implementation of this function can be found in Atlas.sol
Parameters
Name | Type | Description |
---|---|---|
environment | address | ExecutionEnvironment address |
user | address | The address of the user invoking the function. |
control | address | The address of the current DAppControl contract. |
callConfig | uint32 | The CallConfig of the DAppControl contract of the current transaction. |
transferUserERC20
function transferUserERC20(address token, address destination, uint256 amount, address user, address control) external
Transfers ERC20 tokens from a user to a destination address, only callable by the expected Execution Environment.
Parameters
Name | Type | Description |
---|---|---|
token | address | The address of the ERC20 token contract. |
destination | address | The address to which the tokens will be transferred. |
amount | uint256 | The amount of tokens to transfer. |
user | address | The address of the user invoking the function. |
control | address | The address of the current DAppControl contract. |
transferDAppERC20
function transferDAppERC20(address token, address destination, uint256 amount, address user, address control) external
Transfers ERC20 tokens from the DAppControl contract to a destination address, only callable by the expected Execution Environment.
Parameters
Name | Type | Description |
---|---|---|
token | address | The address of the ERC20 token contract. |
destination | address | The address to which the tokens will be transferred. |
amount | uint256 | The amount of tokens to transfer. |
user | address | The address of the user invoking the function. |
control | address | The address of the current DAppControl contract. |
_validateTransfer
function _validateTransfer(address user, address control, uint8 safeExecutionPhaseSet) internal
Verifies whether the lock state allows execution in the specified safe execution phase.
Parameters
Name | Type | Description |
---|---|---|
user | address | The address of the user invoking the function. |
control | address | The address of the current DAppControl contract. |
safeExecutionPhaseSet | uint8 | The set of safe execution phases. |