Skip to content

Commit 08c0dd6

Browse files
committed
feat: add new account flow
1 parent 4283fa0 commit 08c0dd6

19 files changed

+60
-432
lines changed

README.md

Lines changed: 24 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@ Template repository for getting started quickly with [Catapulta.sh](https://cata
33

44

55

6-
7-
86
## Getting Started - Dev Container
97
Get onboarded faster using Docker with a developer environment ready to build and deploy Solidity smart contracts:
108
- Click here to open a Solidity environment in Cursor:
@@ -27,7 +25,7 @@ Requirements
2725
- [Node.js](https://gist.github.com/d2s/372b5943bce17b964a79)
2826
- [Foundry](https://book.getfoundry.sh/)
2927

30-
Click "Use this template" on [GitHub](https://github.com/catapulta-sh/catapulta-foundry-template) to create a new repository with this repo as the initial state.
28+
Click "Use this template" on [GitHub](https://github.com/catapulta-sh/catapulta-foundry-template) to get started quickly.
3129

3230
You can also git clone this repository and enter to the repository directory:
3331

@@ -36,7 +34,7 @@ git clone https://github.com/catapulta-sh/catapulta-foundry-template
3634
cd catapulta-foundry-template
3735
```
3836

39-
## Deploy your first contract with Catapulta
37+
## Deploy your first smart contracts with Catapulta
4038

4139
1. Install forge dependencies
4240

@@ -50,22 +48,15 @@ forge install
5048
npm i -g catapulta
5149
```
5250

53-
3. Generate a new private key with Catapulta, is stored offline in your .env, or add your own as `PRIVATE_KEY` in the .env file stored at the root of the project
54-
55-
```
56-
catapulta wallet
57-
58-
# Output:
59-
# Wallet address: 0x6B193d5604e09f1737E33cFc4B06fb3f2C7fC3CE
60-
# Private key appended to your .env file.
61-
```
62-
4. Setup your `CATAPULTA_API_KEY` into your .env, generate one free key at [Catapulta](https://catapulta.sh/auth)
63-
5. Deploy the basic contract into Sepolia testnet with Catapulta, using `--sponsor` flag to request gas. This skips the need of faucets.
51+
3. Deploy smart contracts in Base Sepolia testnet with Catapulta, using `--sponsor` flag to request testnet gas for free.
6452

6553
```
6654
catapulta script script/Deploy.s.sol --network baseSepolia --sponsor
6755
```
6856

57+
> This tool will automatically create a new encrypted account named `CATAPULTA_DEPLOYER` via Foundry `cast wallet import` if you don't provide any keystore account via `--account` param.
58+
59+
The command will build and proceed to broadcast your deployment script to the desired network without RPC configs.
6960
```
7061
# Output:
7162
Catapulta.sh 🏏 Forge script deployment (0.4.1)
@@ -99,10 +90,27 @@ Deployment UUID: 592a91ad-57c8-42c6-b37e-2af0e170f31a
9990
- https://catapulta.sh/project/6416272a59b37a3a4a7afb55/op/595a91ad-57c8-42c6-b37e-2af0e170f31a
10091
```
10192

102-
7. Check the deployment report at the Catapulta UI, and enjoy automated Etherscan verification without any extra configs or API keys.
93+
4. Check the deployment report at the Catapulta UI, and enjoy automated block explorer verification in Etherscan, Blockscout and Sourcify without any extra configs.
10394

10495
<img src="https://catapulta.sh/img/report.png" style="max-width: 800px; width: 100%;">
10596

97+
### Other useful commands
98+
99+
Import older deployments in Catapulta and trigger verification in block explorers:
100+
```
101+
catapulta import broadcast/[Deploy.s.sol]/[Chain ID]/run-latest.json
102+
```
103+
104+
Create or view your deployer wallet address:
105+
```
106+
catapulta wallet
107+
```
108+
109+
Sign in and open the Catapulta dashboard UI:
110+
```
111+
catapulta login
112+
```
113+
106114
## Development
107115

108116
This project uses [Foundry](https://getfoundry.sh) and [Catapulta](https://catapulta.sh/docs).

script/Deploy.s.sol

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3,19 +3,15 @@ pragma solidity ^0.8.20;
33

44
import {Script} from "forge-std/Script.sol";
55
import {BatteringRam} from "../src/BatteringRam.sol";
6-
import {Catapult} from "../src/Catapult.sol";
76
import {Trebuchet} from "../src/Trebuchet.sol";
87
import {CatapultNFT} from "../src/CatapultNFT.sol";
98

109
contract DeploySiege is Script {
1110
function run() public {
12-
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
13-
14-
vm.startBroadcast(deployerPrivateKey);
11+
vm.startBroadcast();
1512

1613
new CatapultNFT("https://ipfs.io/ipfs/QmUCd8sGk4uVhGFfXX5aixNod3Eky8kD4Cvjo25UDnhPrQ");
1714
new BatteringRam(50);
18-
new Catapult(100);
1915
new Trebuchet(200, msg.sender);
2016

2117
vm.stopBroadcast();

script/DeployERC20.sol

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.20;
3+
4+
import {Script} from "forge-std/Script.sol";
5+
import {ERC20Token} from "../src/tokens/ERC20Token.sol";
6+
7+
contract DeployERC20 is Script {
8+
function run() public {
9+
vm.startBroadcast();
10+
11+
new ERC20Token(1_000_000e18);
12+
13+
vm.stopBroadcast();
14+
}
15+
}

script/DeployNFT.sol

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,17 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.20;
3+
4+
import {Script} from "forge-std/Script.sol";
5+
import {NFT} from "../src/tokens/NFT.sol";
6+
7+
contract DeployNFT is Script {
8+
function run() external {
9+
string memory initialBaseURI = "ipfs://baseuri/";
10+
11+
vm.startBroadcast();
12+
13+
new NFT("NFT Art", "ART", initialBaseURI);
14+
15+
vm.stopBroadcast();
16+
}
17+
}

script/Spell.s.sol

Lines changed: 0 additions & 17 deletions
This file was deleted.

script/Trebuchet.s.sol

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,7 @@ import {Trebuchet} from "../src/Trebuchet.sol";
66

77
contract DeployTrebuchet is Script {
88
function run() public {
9-
uint256 deployerPrivateKey = vm.envUint("PRIVATE_KEY");
10-
11-
vm.startBroadcast(deployerPrivateKey);
9+
vm.startBroadcast();
1210

1311
new Trebuchet(200, msg.sender);
1412

script/token/DeployMyNFT.sol

Lines changed: 0 additions & 18 deletions
This file was deleted.

script/token/DeployMyToken.sol

Lines changed: 0 additions & 17 deletions
This file was deleted.

script/token/DeployVault.s.sol

Lines changed: 0 additions & 27 deletions
This file was deleted.

src/Catapult.sol

Lines changed: 0 additions & 19 deletions
This file was deleted.

0 commit comments

Comments
 (0)