Skip to content

Commit eca2373

Browse files
authored
fix: legacy option, remove cast task, readme (#6)
- Use --legacy option - Update readme - Remove cast from tasks
1 parent e859c6d commit eca2373

File tree

3 files changed

+22
-24
lines changed

3 files changed

+22
-24
lines changed

.vscode/tasks.json

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -43,9 +43,9 @@
4343
"problemMatcher": []
4444
},
4545
{
46-
"label": "deploy",
46+
"label": "deploy-btp",
4747
"type": "shell",
48-
"command": "EXTRA_ARGS=\"${input:extra-deployment-verify} ${input:extra-deployment-other}\" make deploy",
48+
"command": "EXTRA_ARGS=\"${input:extra-deployment-verify} ${input:extra-deployment-other}\" make deploy-btp",
4949
"problemMatcher": []
5050
},
5151
{
@@ -60,12 +60,6 @@
6060
"command": "EXTRA_ARGS=\"${input:extra-script-broadcast} ${input:extra-script-other}\" make script",
6161
"problemMatcher": []
6262
},
63-
{
64-
"label": "cast",
65-
"type": "shell",
66-
"command": "make cast",
67-
"problemMatcher": []
68-
},
6963
{
7064
"label": "help",
7165
"type": "shell",

Makefile

Lines changed: 16 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -26,23 +26,23 @@ deploy-anvil:
2626
@echo "Deploying with Forge to Anvil..."
2727
@forge create ./src/Counter.sol:Counter --rpc-url anvil --interactive | tee deployment-anvil.txt
2828

29-
deploy:
29+
deploy-btp:
3030
@eval $$(curl -H "x-auth-token: $${BTP_SERVICE_TOKEN}" -s $${BTP_CLUSTER_MANAGER_URL}/ide/foundry/$${BTP_SCS_ID}/env | sed 's/^/export /'); \
31-
if [ -z "$${BTP_FROM}" ]; then \
31+
args=""; \
32+
if [ ! -z "$${BTP_FROM}" ]; then \
33+
args="--unlocked --from $${BTP_FROM}"; \
34+
else \
3235
echo "\033[1;33mWARNING: No keys are activated on the node, falling back to interactive mode...\033[0m"; \
3336
echo ""; \
34-
if [ -z "$${BTP_GAS_PRICE}" ]; then \
35-
forge create ./src/Counter.sol:Counter $${EXTRA_ARGS} --rpc-url $${BTP_RPC_URL} --interactive | tee deployment.txt; \
36-
else \
37-
forge create ./src/Counter.sol:Counter $${EXTRA_ARGS} --rpc-url $${BTP_RPC_URL} --interactive --gas-price $${BTP_GAS_PRICE} | tee deployment.txt; \
38-
fi; \
39-
else \
40-
if [ -z "$${BTP_GAS_PRICE}" ]; then \
41-
forge create ./src/Counter.sol:Counter $${EXTRA_ARGS} --rpc-url $${BTP_RPC_URL} --unlocked --from $${BTP_FROM} | tee deployment.txt; \
42-
else \
43-
forge create ./src/Counter.sol:Counter $${EXTRA_ARGS} --rpc-url $${BTP_RPC_URL} --unlocked --from $${BTP_FROM} --gas-price $${BTP_GAS_PRICE} | tee deployment.txt; \
44-
fi; \
45-
fi
37+
args="--interactive"; \
38+
fi; \
39+
if [ ! -z "$${BTP_GAS_PRICE}" ]; then \
40+
args="$$args --gas-price $${BTP_GAS_PRICE}"; \
41+
fi; \
42+
if [ "$${BTP_EIP_1559_ENABLED}" = "false" ]; then \
43+
args="$$args --legacy"; \
44+
fi; \
45+
forge create ./src/Counter.sol:Counter $${EXTRA_ARGS} --rpc-url $${BTP_RPC_URL} $$args --constructor-args "GenericToken" "GT" | tee deployment.txt;
4646

4747
script-anvil:
4848
@if [ ! -f deployment-anvil.txt ]; then \
@@ -52,8 +52,8 @@ script-anvil:
5252
@DEPLOYED_ADDRESS=$$(grep "Deployed to:" deployment-anvil.txt | awk '{print $$3}') forge script script/Counter.s.sol:CounterScript ${EXTRA_ARGS} --rpc-url anvil -i=1
5353

5454
script:
55-
@if [ ! -f deployment-anvil.txt ]; then \
56-
echo "\033[1;31mERROR: Contract was not deployed or the deployment-anvil.txt went missing.\033[0m"; \
55+
@if [ ! -f deployment.txt ]; then \
56+
echo "\033[1;31mERROR: Contract was not deployed or the deployment.txt went missing.\033[0m"; \
5757
exit 1; \
5858
fi
5959
@eval $$(curl -H "x-auth-token: $${BTP_SERVICE_TOKEN}" -s $${BTP_CLUSTER_MANAGER_URL}/ide/foundry/$${BTP_SCS_ID}/env | sed 's/^/export /'); \

README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,16 @@ Deploy to a local anvil node:
7070
$ make deploy-anvil
7171
```
7272

73+
When prompted to enter a private key, copy one of the private keys shown in the terminal when you start the anvil node.
74+
7375
Deploy to the connected platform node:
7476

7577
```shell
7678
$ make deploy-btp
7779
```
7880

81+
If you have a private key activated on the connected node, it will be used automatically. Else, you will be prompted to enter a private key. You can copy-paste a private key from the platform.
82+
7983
### Cast
8084

8185
```shell

0 commit comments

Comments
 (0)