Skip to content

Commit

Permalink
Merge 'master' into feat/plugSpecificConfirmation
Browse files Browse the repository at this point in the history
  • Loading branch information
tHeMaskedMan981 committed Jun 27, 2024
2 parents ee9da5a + eb500b0 commit ac8c295
Show file tree
Hide file tree
Showing 60 changed files with 4,027 additions and 2,319 deletions.
3 changes: 2 additions & 1 deletion .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,7 @@ BLAST_RPC=''
# SOCKET_SIGNER_KEY=xxx

POLYNOMIAL_RPC=''
SYNDR_RPC=' '

DL_API_DEV_URL=''
DL_API_PROD_URL=''
DL_API_PROD_URL=''
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ It is recommended to setup the ide to work with solidity development. In case of
| InvalidNonce() | 0x756688fe |
| MsgValueTooLow() | 0x508aaf00 |
| MsgValueTooHigh() | 0x5dffc92f |
| PayloadTooLarge() | 0x492f620d |
| InsufficientMsgValue() | 0x78f38f76 |
| InsufficientFees() | 0x8d53e553 |
| InvalidMsgValue() | 0x1841b4e1 |
| FeesTooHigh() | 0xc9034e18 |
| PayloadTooLarge() | 0x492f620d |
| InvalidBatchSize() | 0x7862e959 |
| InsufficientMessageLength() | 0xbcfdc01d |
| InvalidPacketLength() | 0x5a375a8e |
Expand Down
42 changes: 13 additions & 29 deletions contracts/ExecutionManager.sol
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ import {FEES_UPDATE_SIG_IDENTIFIER, RELATIVE_NATIVE_TOKEN_PRICE_UPDATE_SIG_IDENT
* managing execution and other fees. This contract also implements the AccessControl interface, allowing for role-based
* access control.
*/
contract ExecutionManager is IExecutionManager, AccessControlExtended {
contract ExecutionManager is AccessControlExtended {
ISignatureVerifier public immutable signatureVerifier__;
ISocket public immutable socket__;
uint32 public immutable chainSlug;
Expand All @@ -25,7 +25,7 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
* @param siblingChainSlug The destination chain slug for which the executionFees is updated
* @param executionFees The new executionFees
*/
event ExecutionFeesSet(uint256 siblingChainSlug, uint128 executionFees);
event ExecutionFeesSet(uint32 siblingChainSlug, uint128 executionFees);

/**
* @notice Emitted when the relativeNativeTokenPrice is updated
Expand Down Expand Up @@ -183,13 +183,7 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
function isExecutor(
bytes32 packedMessage,
bytes memory sig
)
external
view
virtual
override
returns (address executor, bool isValidExecutor)
{
) external view virtual returns (address executor, bool isValidExecutor) {
executor = signatureVerifier__.recoverSigner(packedMessage, sig);
isValidExecutor = _hasRole(EXECUTOR_ROLE, executor);
}
Expand All @@ -198,17 +192,11 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
* @notice updates the total fee used by an executor to execute a message
* @dev to be used for accounting when onchain fee distribution for individual executors is implemented
* @dev this function should be called by socket only
* @inheritdoc IExecutionManager
*/
function updateExecutionFees(
address,
uint128,
bytes32
) external view override {
function updateExecutionFees(address, uint128, bytes32) external view {
if (msg.sender != address(socket__)) revert OnlySocket();
}

/// @inheritdoc IExecutionManager
function payAndCheckFees(
uint256 minMsgGasLimit_,
uint256 payloadSize_,
Expand All @@ -223,7 +211,6 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
)
external
payable
override
returns (uint128 executionFee, uint128 transmissionFees)
{
if (msg.value >= type(uint128).max) revert InvalidMsgValue();
Expand Down Expand Up @@ -282,7 +269,7 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
uint256 payloadSize_,
bytes32 executionParams_,
uint32 siblingChainSlug_
) external view override returns (uint128 minExecutionFee) {
) external view returns (uint128 minExecutionFee) {
minExecutionFee = _getMinFees(
gasLimit_,
payloadSize_,
Expand All @@ -291,7 +278,6 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
);
}

/// @inheritdoc IExecutionManager
function getExecutionTransmissionMinFees(
uint256 minMsgGasLimit_,
uint256 payloadSize_,
Expand All @@ -302,7 +288,6 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
)
external
view
override
returns (uint128 minExecutionFee, uint128 transmissionFees)
{
minExecutionFee = _getMinFees(
Expand Down Expand Up @@ -357,7 +342,7 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
function verifyParams(
bytes32 executionParams_,
uint256 msgValue_
) external pure override {
) external pure {
uint256 params = uint256(executionParams_);
uint8 paramType = uint8(params >> 248);

Expand All @@ -381,7 +366,7 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
uint32 siblingChainSlug_,
uint128 executionFees_,
bytes calldata signature_
) external override {
) external {
address feesUpdater = signatureVerifier__.recoverSigner(
keccak256(
abi.encode(
Expand Down Expand Up @@ -420,7 +405,7 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
uint32 siblingChainSlug_,
uint256 relativeNativeTokenPrice_,
bytes calldata signature_
) external override {
) external {
address feesUpdater = signatureVerifier__.recoverSigner(
keccak256(
abi.encode(
Expand Down Expand Up @@ -461,7 +446,7 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
uint32 siblingChainSlug_,
uint256 msgValueMinThreshold_,
bytes calldata signature_
) external override {
) external {
address feesUpdater = signatureVerifier__.recoverSigner(
keccak256(
abi.encode(
Expand Down Expand Up @@ -498,7 +483,7 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
uint32 siblingChainSlug_,
uint256 msgValueMaxThreshold_,
bytes calldata signature_
) external override {
) external {
address feesUpdater = signatureVerifier__.recoverSigner(
keccak256(
abi.encode(
Expand Down Expand Up @@ -526,12 +511,11 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
/**
* @notice updates the transmission fee needed for transmission
* @dev this function stores value against msg.sender hence expected to be called by transmit manager
* @inheritdoc IExecutionManager
*/
function setTransmissionMinFees(
uint32 remoteChainSlug_,
uint128 fees_
) external override {
) external {
transmissionMinFees[msg.sender][remoteChainSlug_] = fees_;
}

Expand Down Expand Up @@ -568,7 +552,7 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
uint32 siblingChainSlug_,
address switchboard_,
uint128 amount_
) external override {
) external {
if (totalSwitchboardFees[switchboard_][siblingChainSlug_] < amount_)
revert InsufficientFees();

Expand All @@ -590,7 +574,7 @@ contract ExecutionManager is IExecutionManager, AccessControlExtended {
function withdrawTransmissionFees(
uint32 siblingChainSlug_,
uint128 amount_
) external override {
) external {
if (
totalExecutionAndTransmissionFees[siblingChainSlug_]
.totalTransmissionFees < amount_
Expand Down
Loading

0 comments on commit ac8c295

Please sign in to comment.