Skip to content

Commit

Permalink
Merge pull request #92 from bgd-labs/fix/update-create2
Browse files Browse the repository at this point in the history
fix: re added create2 methods
  • Loading branch information
sendra authored Jul 29, 2024
2 parents 5a9a33a + 81bae3b commit cb7fc0c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 7 deletions.
2 changes: 1 addition & 1 deletion lib/solidity-utils
13 changes: 7 additions & 6 deletions scripts/BaseScript.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,21 +2,22 @@
pragma solidity ^0.8.0;

import {ChainIds, TestNetChainIds} from 'solidity-utils/contracts/utils/ChainHelpers.sol';
import {Create2Utils} from 'solidity-utils/contracts/utils/ScriptUtils.sol';

abstract contract BaseScript {
function TRANSACTION_NETWORK() internal view virtual returns (uint256);

// Should only implement as:
// return Create2Utils.create2Deploy(keccak256(abi.encode(salt)), byteCode);
function _deployByteCode(
bytes memory byteCode,
string memory salt
) internal virtual returns (address);
) internal virtual returns (address) {
return Create2Utils.create2Deploy(keccak256(abi.encode(salt)), byteCode);
}

// Should only implement as:
// return Create2Utils.computeCreate2Address(salt, adapterCode);
function _computeByteCodeAddress(
bytes memory byteCode,
string memory salt
) internal virtual returns (address);
) internal virtual returns (address) {
return Create2Utils.computeCreate2Address(keccak256(abi.encode(salt)), byteCode);
}
}

0 comments on commit cb7fc0c

Please sign in to comment.