Skip to content

Commit

Permalink
empty metas
Browse files Browse the repository at this point in the history
  • Loading branch information
thedavidmeister committed Jan 7, 2024
1 parent 93b91f8 commit f8afabe
Show file tree
Hide file tree
Showing 5 changed files with 9 additions and 34 deletions.
17 changes: 1 addition & 16 deletions flake.nix
Original file line number Diff line number Diff line change
Expand Up @@ -13,28 +13,13 @@

in rec {
packages = rec {
concrete-contracts = ["OrderBook" "GenericPoolOrderBookV3FlashBorrower" "GenericPoolOrderBookV3ArbOrderTaker" "RouteProcessorOrderBookV3ArbOrderTaker"];
build-meta-cmd = contract: ''
rain meta build \
-i <(rain meta solc artifact -c abi -i out/${contract}.sol/${contract}.json) -m solidity-abi-v2 -t json -e deflate -l en \
-i src/concrete/${contract}.meta.json -m interpreter-caller-meta-v1 -t json -e deflate -l en \
'';
build-single-meta = contract: ''
${(build-meta-cmd contract)} -o meta/${contract}.rain.meta;
'';

build-meta = rainix.mkTask.${system} { name = "build-meta"; body = (''
set -x;
mkdir -p meta;
forge build --force;
'' + pkgs.lib.concatStrings (map build-single-meta concrete-contracts)); };

deploy-single-contract = contract: ''
forge script script/Deploy${contract}.sol:Deploy${contract} --legacy --verify --broadcast --rpc-url "''${CI_DEPLOY_RPC_URL}" --etherscan-api-key "''${EXPLORER_VERIFICATION_KEY}" \
--sig='run(bytes)' \
"$( ${(build-meta-cmd contract)} -E hex )" \
;
'';

deploy-contracts = rainix.mkTask.${system} { name = "deploy-contracts"; body = (''
set -euo pipefail;
forge build --force;
Expand Down
7 changes: 2 additions & 5 deletions script/DeployGenericPoolOrderBookV3ArbOrderTaker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ import {I9R_DEPLOYER} from "./DeployConstants.sol";
/// is intended to be run on every commit by CI to a testnet such as mumbai, then
/// cross chain deployed to whatever mainnet is required, by users.
contract DeployGenericPoolOrderBookV3ArbOrderTaker is Script {
/// We are avoiding using ffi here, instead forcing the script runner to
/// provide the built metadata. On CI this is achieved by using the rain cli.
function run(bytes memory meta) external {
function run() external {
uint256 deployerPrivateKey = vm.envUint("DEPLOYMENT_KEY");

console2.log("GenericPoolOrderBookV3ArbOrderTaker meta hash:");
console2.logBytes32(keccak256(meta));
bytes memory meta = hex"";

vm.startBroadcast(deployerPrivateKey);
GenericPoolOrderBookV3ArbOrderTaker deployed =
Expand Down
7 changes: 2 additions & 5 deletions script/DeployGenericPoolOrderBookV3FlashBorrower.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ import {I9R_DEPLOYER} from "./DeployConstants.sol";
/// is intended to be run on every commit by CI to a testnet such as mumbai, then
/// cross chain deployed to whatever mainnet is required, by users.
contract DeployGenericPoolOrderBookV3FlashBorrower is Script {
/// We are avoiding using ffi here, instead forcing the script runner to
/// provide the built metadata. On CI this is achieved by using the rain cli.
function run(bytes memory meta) external {
function run() external {
uint256 deployerPrivateKey = vm.envUint("DEPLOYMENT_KEY");

console2.log("DeployGenericPoolOrderBookV3FlashBorrower meta hash:");
console2.logBytes32(keccak256(meta));
bytes memory meta = hex"";

vm.startBroadcast(deployerPrivateKey);
GenericPoolOrderBookV3FlashBorrower deployed =
Expand Down
5 changes: 2 additions & 3 deletions script/DeployOrderBook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,10 @@ import {OrderBook, DeployerDiscoverableMetaV3ConstructionConfig} from "src/concr
import {I9R_DEPLOYER} from "./DeployConstants.sol";

contract DeployOrderBook is Script {
function run(bytes memory meta) external {
function run() external {
uint256 deployerPrivateKey = vm.envUint("DEPLOYMENT_KEY");

console2.log("DeployOrderBook meta hash:");
console2.logBytes32(keccak256(meta));
bytes memory meta = hex"";

vm.startBroadcast(deployerPrivateKey);
OrderBook deployed = new OrderBook(DeployerDiscoverableMetaV3ConstructionConfig(I9R_DEPLOYER, meta));
Expand Down
7 changes: 2 additions & 5 deletions script/DeployRouteProcessorOrderBookV3ArbOrderTaker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,10 @@ import {I9R_DEPLOYER} from "./DeployConstants.sol";
/// is intended to be run on every commit by CI to a testnet such as mumbai, then
/// cross chain deployed to whatever mainnet is required, by users.
contract DeployRouteProcessorOrderBookV3ArbOrderTaker is Script {
/// We are avoiding using ffi here, instead forcing the script runner to
/// provide the built metadata. On CI this is achieved by using the rain cli.
function run(bytes memory meta) external {
function run() external {
uint256 deployerPrivateKey = vm.envUint("DEPLOYMENT_KEY");

console2.log("RouteProcessorOrderBookV3ArbOrderTaker meta hash:");
console2.logBytes32(keccak256(meta));
bytes memory meta = hex"";

vm.startBroadcast(deployerPrivateKey);
RouteProcessorOrderBookV3ArbOrderTaker deployed =
Expand Down

0 comments on commit f8afabe

Please sign in to comment.