Skip to content

Commit

Permalink
chore(evm): deploy relevant intent artifacts
Browse files Browse the repository at this point in the history
We are deploying the DestinationSettler and the IntentValidator. The
existing OriginSettler on Odyssey will suffice for our purposes.
  • Loading branch information
topocount committed Dec 19, 2024
1 parent 751ac1a commit c0e7607
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
4 changes: 2 additions & 2 deletions packages/evm/contracts/intents/DestinationSettler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -45,9 +45,9 @@ contract DestinationSettler is ReentrancyGuard {
// Called by filler, who sees ERC7683 intent emitted on origin chain
// containing the callsByUser data to be executed following a 7702 delegation.
// @dev We don't use the last parameter `fillerData` in this function.
function fill(bytes32 orderId, bytes calldata originData, bytes calldata fillerData) external nonReentrant {
function fill(bytes32 orderId, bytes calldata originData, bytes calldata rawFillerData) external nonReentrant {
(CallByUser memory callsByUser) = abi.decode(originData, (CallByUser));
(FillerData memory fillerData) = abi.decode(fillerData, (FillerData));
(FillerData memory fillerData) = abi.decode(rawFillerData, (FillerData));
if (ResolvedCrossChainOrderLib.getOrderId(callsByUser) != orderId) revert InvalidOrderId();

// Protect against duplicate fills.
Expand Down
20 changes: 20 additions & 0 deletions packages/evm/script/solidity/Deploy_Modules.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,9 @@ import {SimpleAllowList} from "contracts/allowlists/SimpleAllowList.sol";
import {SimpleDenyList} from "contracts/allowlists/SimpleDenyList.sol";

import {SignerValidator} from "contracts/validators/SignerValidator.sol";
import {IntentValidator} from "contracts/validators/IntentValidator.sol";

import {DestinationSettler} from "contracts/intents/DestinationSettler.sol";

/// @notice this script deploys and registers budgets, actions, and incentives
contract ModuleBaseDeployer is ScriptUtils {
Expand Down Expand Up @@ -237,4 +240,21 @@ contract ModuleBaseDeployer is ScriptUtils {

_registerIfNew(newDeploy, "SimpleDenyList", simpleDenyList, registry, ABoostRegistry.RegistryType.ALLOW_LIST);
}

function _deployIntentValidator(BoostRegistry registry) internal returns (address intentValidator) {
// Deploy DestinationSettler since it's an input to IntentValidator
bytes memory settlerInitCode = type(DestinationSettler).creationCode;
address settler = _getCreate2Address(settlerInitCode, "");
console.log("DestinationSettler: ", settler);
deployJson = deployJsonKey.serialize("DestinationSettler", settler);
_deploy2(settlerInitCode, "");

bytes memory initCode = type(IntentValidator).creationCode;
intentValidator = _getCreate2Address(initCode, "");
console.log("SimpleDenyList: ", intentValidator);
deployJson = deployJsonKey.serialize("IntentValidator", intentValidator);
bool newDeploy = _deploy2(initCode, "");

_registerIfNew(newDeploy, "IntentValidator", intentValidator, registry, ABoostRegistry.RegistryType.VALIDATOR);
}
}

0 comments on commit c0e7607

Please sign in to comment.