Skip to content

Commit

Permalink
update README + docs
Browse files Browse the repository at this point in the history
  • Loading branch information
caglacelik committed Dec 5, 2024
1 parent 9405ff2 commit 9ed2876
Show file tree
Hide file tree
Showing 16 changed files with 102 additions and 92 deletions.
4 changes: 2 additions & 2 deletions .env.example
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
# Deployer key (REQUIRED)
PUBLIC_KEY=change_me
# API KEY (REQUIRED FOR CONTRACT VERIFICATION)
ETHERSCAN_API_KEY=CHANGE_ME
21 changes: 13 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ forge build
Run tests on local:

```sh
forge test
forge test --force
```

or on any other evm chain:

```sh
forge test --rpc-url <CHAIN_RPC_URL>
forge test --rpc-url <RPC_URL>
```

## Deployment

**Step 1.**
Import your `PUBLIC_KEY` and `ETHERSCAN_API_KEY` to env file.
Import your `ETHERSCAN_API_KEY` to env file.

> [!NOTE]
>
Expand Down Expand Up @@ -69,18 +69,23 @@ anvil
```

**Step 5.**
Deploy the contracts on local with:
Deploy the contracts with:

```sh
forge script ./script/Deploy.s.sol:Deploy --account <FILE_NAME_OF_YOUR_KEYSTORE> --sender <DEPLOYER_PUBLIC_KEY> --broadcast
forge script ./script/Deploy.s.sol:Deploy --rpc-url <RPC_URL> --account <FILE_NAME_OF_YOUR_KEYSTORE> --sender <DEPLOYER_PUBLIC_KEY> --broadcast
```
or for instant verification use:

```sh
forge script ./script/Deploy.s.sol:Deploy --account <FILE_NAME_OF_YOUR_KEYSTORE> --sender <DEPLOYER_PUBLIC_KEY> --broadcast --verify --verifier <etherscan|blockscout|sourcify>
forge script ./script/Deploy.s.sol:Deploy --rpc-url <RPC_URL> --account <FILE_NAME_OF_YOUR_KEYSTORE> --sender <DEPLOYER_PUBLIC_KEY> --broadcast --verify --verifier <etherscan|blockscout|sourcify> --verifier-url <VERIFIER_URL>
```

Deployment for another chain add `--rpc-url <CHAIN_URL>` to commands above.
> [!NOTE]
> `<VERIFIER_URL>` should be expolorer's homepage url. Forge reads your `<ETHERSCAN_API_KEY>` from .env file so you don't need to add this at the end of `<VERIFIER_URL>`.
>
> e.g.
> `https://base-sepolia.blockscout.com/api/` for `Base Sepolia Network`
>
You can see deployed contract addresses under the `deployment/<chainid>.json`

Expand All @@ -89,7 +94,7 @@ You can see deployed contract addresses under the `deployment/<chainid>.json`
Verify contract manually with:

```sh
forge verify-contract <CONTRACT_ADDRESS> src/$<CONTRACT_NAME>.sol:<CONTRACT_NAME> --verifier <etherscan|blockscout|sourcify>
forge verify-contract <CONTRACT_ADDRESS> src/$<CONTRACT_NAME>.sol:<CONTRACT_NAME> --verifier <etherscan|blockscout|sourcify> --verifier-url <VERIFIER_URL>
```

## Coverage
Expand Down
16 changes: 8 additions & 8 deletions deployment/84532.json
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
{
"LLMOracleRegistry": {
"proxyAddr": "0x90193c961a926261b756d1e5bb255e67ff9498a1",
"implAddr": "0x34a1d3fff3958843c43ad80f30b94c510645c316"
"proxyAddr": "0xb80c3ddf6ff026d96963a2d08d35b8f7129397d1",
"implAddr": "0x3625af0a83468c2518785fc69048f0b176b01aa3"
},
"LLMOracleCoordinator": {
"proxyAddr": "0xbb2180ebd78ce97360503434ed37fcf4a1df61c3",
"implAddr": "0xa8452ec99ce0c64f20701db7dd3abdb607c00496"
"proxyAddr": "0xb67408a1c7b91717660304fffedff4874b971f02",
"implAddr": "0xfb456fb09d617fb81550630597c64d4c4df00a30"
},
"Swan": {
"proxyAddr": "0xdeb1e9a6be7baf84208bb6e10ac9f9bbe1d70809",
"implAddr": "0x62c20aa1e0272312bc100b4e23b4dc1ed96dd7d1"
"proxyAddr": "0xfbae7842a3cc991dc3226330fe1b60f9c369aff0",
"implAddr": "0xcc2213440c9cbe2da375e5dd6c035f6407ea684e"
},
"BuyerAgentFactory": "0xdb8cff278adccf9e9b5da745b44e754fc4ee3c76",
"SwanAssetFactory": "0x50eef481cae4250d252ae577a09bf514f224c6c4"
"BuyerAgentFactory": "0x05d56d25841282e9a5a152c20990181662114d11",
"SwanAssetFactory": "0xba24509485b996b3a94f4c36ff16c902765550ac"
}
23 changes: 14 additions & 9 deletions docs/src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,19 +18,19 @@ forge build
Run tests on local:

```sh
forge test
forge test --force
```

or on any other evm chain:

```sh
forge test --rpc-url <CHAIN_RPC_URL>
forge test --rpc-url <RPC_URL>
```

## Deployment

**Step 1.**
Import your `PUBLIC_KEY` and `ETHERSCAN_API_KEY` to env file.
Import your `ETHERSCAN_API_KEY` to env file.

> [!NOTE]
>
Expand Down Expand Up @@ -69,18 +69,23 @@ anvil
```

**Step 5.**
Deploy the contracts on local with:
Deploy the contracts with:

```sh
forge script ./script/Deploy.s.sol:Deploy --account <FILE_NAME_OF_YOUR_KEYSTORE> --sender <DEPLOYER_PUBLIC_KEY> --broadcast
forge script ./script/Deploy.s.sol:Deploy --rpc-url <RPC_URL> --account <FILE_NAME_OF_YOUR_KEYSTORE> --sender <DEPLOYER_PUBLIC_KEY> --broadcast
```
or for instant verification use:

```sh
forge script ./script/Deploy.s.sol:Deploy --account <FILE_NAME_OF_YOUR_KEYSTORE> --sender <DEPLOYER_PUBLIC_KEY> --broadcast --verify --verifier <etherscan|blockscout|sourcify>
forge script ./script/Deploy.s.sol:Deploy --rpc-url <RPC_URL> --account <FILE_NAME_OF_YOUR_KEYSTORE> --sender <DEPLOYER_PUBLIC_KEY> --broadcast --verify --verifier <etherscan|blockscout|sourcify> --verifier-url <VERIFIER_URL>
```

Deployment for another chain add `--rpc-url <CHAIN_URL>` to commands above.
> [!NOTE]
> `<VERIFIER_URL>` should be expolorer's homepage url. Forge reads your `<ETHERSCAN_API_KEY>` from .env file so you don't need to add this at the end of `<VERIFIER_URL>`.
>
> e.g.
> `https://base-sepolia.blockscout.com/api/` for `Base Sepolia Network`
>
You can see deployed contract addresses under the `deployment/<chainid>.json`

Expand All @@ -89,7 +94,7 @@ You can see deployed contract addresses under the `deployment/<chainid>.json`
Verify contract manually with:

```sh
forge verify-contract <CONTRACT_ADDRESS> src/$<CONTRACT_NAME>.sol:<CONTRACT_NAME> --verifier <etherscan|blockscout|sourcify>
forge verify-contract <CONTRACT_ADDRESS> src/$<CONTRACT_NAME>.sol:<CONTRACT_NAME> --verifier <etherscan|blockscout|sourcify> --verifier-url <VERIFIER_URL>
```

## Coverage
Expand All @@ -102,7 +107,7 @@ forge clean && bash coverage.sh
or to see summarized coverages on terminal:

```sh
forge coverage --no-match-coverage "(test|mock|script)"
forge clean && forge coverage --no-match-coverage "(test|mock|script)"
```

You can see coverages under the coverage directory.
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/BuyerAgent.sol/contract.BuyerAgent.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# BuyerAgent
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/71d5f1b72c5506ee91313ea31c9a617e611d9d74/src/BuyerAgent.sol)
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/9405ff2bcd559928c6612c334c22d32bfecae969/src/BuyerAgent.sol)

**Inherits:**
Ownable
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/BuyerAgent.sol/contract.BuyerAgentFactory.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# BuyerAgentFactory
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/71d5f1b72c5506ee91313ea31c9a617e611d9d74/src/BuyerAgent.sol)
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/9405ff2bcd559928c6612c334c22d32bfecae969/src/BuyerAgent.sol)

Factory contract to deploy BuyerAgent contracts.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/Swan.sol/constants.Swan.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Constants
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/71d5f1b72c5506ee91313ea31c9a617e611d9d74/src/Swan.sol)
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/9405ff2bcd559928c6612c334c22d32bfecae969/src/Swan.sol)

### SwanBuyerPurchaseOracleProtocol

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/Swan.sol/contract.Swan.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Swan
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/71d5f1b72c5506ee91313ea31c9a617e611d9d74/src/Swan.sol)
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/9405ff2bcd559928c6612c334c22d32bfecae969/src/Swan.sol)

**Inherits:**
[SwanManager](/src/SwanManager.sol/abstract.SwanManager.md), UUPSUpgradeable
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/SwanAsset.sol/contract.SwanAsset.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SwanAsset
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/71d5f1b72c5506ee91313ea31c9a617e611d9d74/src/SwanAsset.sol)
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/9405ff2bcd559928c6612c334c22d32bfecae969/src/SwanAsset.sol)

**Inherits:**
ERC721, Ownable
Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/SwanAsset.sol/contract.SwanAssetFactory.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SwanAssetFactory
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/71d5f1b72c5506ee91313ea31c9a617e611d9d74/src/SwanAsset.sol)
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/9405ff2bcd559928c6612c334c22d32bfecae969/src/SwanAsset.sol)

Factory contract to deploy SwanAsset tokens.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/SwanManager.sol/abstract.SwanManager.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SwanManager
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/71d5f1b72c5506ee91313ea31c9a617e611d9d74/src/SwanManager.sol)
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/9405ff2bcd559928c6612c334c22d32bfecae969/src/SwanManager.sol)

**Inherits:**
OwnableUpgradeable
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SwanMarketParameters
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/71d5f1b72c5506ee91313ea31c9a617e611d9d74/src/SwanManager.sol)
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/9405ff2bcd559928c6612c334c22d32bfecae969/src/SwanManager.sol)

Collection of market-related parameters.

Expand Down
2 changes: 1 addition & 1 deletion docs/src/src/mock/SvanV2.sol/contract.SwanV2.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# SwanV2
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/71d5f1b72c5506ee91313ea31c9a617e611d9d74/src/mock/SvanV2.sol)
[Git Source](https://github.com/firstbatchxyz/swan-contracts/blob/9405ff2bcd559928c6612c334c22d32bfecae969/src/mock/SvanV2.sol)

**Inherits:**
[Swan](/src/Swan.sol/contract.Swan.md)
Expand Down
Loading

0 comments on commit 9ed2876

Please sign in to comment.