From 3dfd5f03c45f9a15b34ec6e36cfaf0a9d895fa45 Mon Sep 17 00:00:00 2001 From: "chalex.eth" <43524913+chalex-eth@users.noreply.github.com> Date: Thu, 10 Oct 2024 12:05:56 +0200 Subject: [PATCH] Add task creation --- Makefile | 12 ++++++++++-- contracts/script/DeployTaskAndAppRegistry.s.sol | 1 + 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Makefile b/Makefile index 22f2696..1468460 100644 --- a/Makefile +++ b/Makefile @@ -4,7 +4,10 @@ help: @grep -E '^[a-zA-Z0-9_-]+:.*?## .*$$' $(MAKEFILE_LIST) | awk 'BEGIN {FS = ":.*?## "}; {printf "\033[36m%-30s\033[0m %s\n", $$1, $$2}' +RPC_URL=http://localhost:8545 DEPLOYER_PK=0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80 +TASK_REGISTRY_ADDRESS=0xe7f1725E7734CE288F8367e1Bb143E90bb3F0512 +TASK_ID=0xc86aab04e8ef18a63006f43fa41a2a0150bae3dbe276d581fa8b5cde0ccbc966 -----------------------------: ## @@ -16,5 +19,10 @@ build-contracts: ## builds all contracts test-contracts: ## tests all contracts cd contracts && forge test -deploy-contracts: ## deploy contracts (you need to run anvil first in a separate terminal) - cd contracts && forge script script/DeployTaskAndAppRegistry.s.sol --rpc-url http://localhost:8545 --broadcast --private-key $(DEPLOYER_PK) +deploy-contracts: ## deploy contracts (you need to run anvil first in a separate terminal and the contract deployed) + cd contracts && forge script script/DeployTaskAndAppRegistry.s.sol --rpc-url $(RPC_URL) --broadcast --private-key $(DEPLOYER_PK) + +__TASKS__: ## + +create-task: ## create a task (you need to run anvil first in a separate terminal and the contract deployed) + cast send $(TASK_REGISTRY_ADDRESS) "createTask(bytes32)" $(TASK_ID) --private-key $(DEPLOYER_PK) --rpc-url $(RPC_URL) \ No newline at end of file diff --git a/contracts/script/DeployTaskAndAppRegistry.s.sol b/contracts/script/DeployTaskAndAppRegistry.s.sol index 6ac1751..aeb482c 100644 --- a/contracts/script/DeployTaskAndAppRegistry.s.sol +++ b/contracts/script/DeployTaskAndAppRegistry.s.sol @@ -20,6 +20,7 @@ contract DeployTaskAndAppRegistry is Script, Constants { taskRegistry = new TaskRegistry(msg.sender, AGGREGATOR_NODE, address(clientAppRegistry)); bytes32 clientAppId = keccak256("ethereum-block-number"); + console2.logBytes32(clientAppId); clientAppRegistry.registerClientApp( clientAppId, ClientAppMetadata({