Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Removes staging & preview address files #232

Merged
merged 7 commits into from
Sep 19, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions .changeset/chatty-months-attend.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@soundxyz/sound-protocol": minor
---

Removes preview & staging address files & updates scripts
5 changes: 5 additions & 0 deletions .changeset/chilly-rivers-check.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
---
"@soundxyz/sound-protocol": patch
---

Change to MIT License
696 changes: 22 additions & 674 deletions LICENSE

Large diffs are not rendered by default.

7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,9 +1,14 @@
# Sound Protocol

### Specification
## Specification

See [spec](./spec.md) for current protocol specification. For details on how to build and run a custom minter instance, see section ["Adding a custom minter module"](./spec.md#adding-a-custom-minter-module) section in spec.

## Deployments

- [mainnet]('/src/json/mainnet.json')
- [goerli]('/src/json/goerli.json')

# Installation

## Prerequisites
Expand Down
5 changes: 2 additions & 3 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@
"author": "soundxyz",
"scripts": {
"build": "forge build",
"deploy:goerli": "source .env && forge script script/solidity/Deploy.s.sol --fork-url $GOERLI_RPC_URL --private-key $PRIVATE_KEY --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv --broadcast",
"deploy:preview": "SOUND_ENV=preview pnpm gen:ids && pnpm deploy:goerli && SOUND_ENV=preview pnpm prep-release",
"deploy:staging": "SOUND_ENV=staging pnpm gen:ids && pnpm deploy:goerli && SOUND_ENV=staging pnpm prep-release",
"deploy:mainnet": "EVM_NETWORK=mainnet pnpm gen:ids && source .env && forge script script/solidity/Deploy.s.sol --fork-url $MAINNET_RPC_URL --private-key $PRIVATE_KEY --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv --broadcast && EVM_NETWORK=mainnet pnpm prep-release",
"deploy:goerli": "EVM_NETWORK=goerli pnpm gen:ids && source .env && forge script script/solidity/Deploy.s.sol --fork-url $GOERLI_RPC_URL --private-key $PRIVATE_KEY --verify --etherscan-api-key $ETHERSCAN_KEY -vvvv --broadcast && EVM_NETWORK=goerli pnpm prep-release",
"gen:ids": "forge script ./script/solidity/GetInterfaceId.s.sol | tr -d '\n' | grep -o '== Logs ==.*' | awk -F'== Logs ==' '/== Logs ==/{print $2}' | tr -d '[:space:]' > src/json/interfaceIds.json && bob-tsm script/js/buildInterfaceIdsFile.ts && pnpm prettier:write",
"postinstall": "forge install",
"prepack": "rm -rf out out-2 dist typechain && pnpm gen:ids && pnpm build && cp -r out out-2 && rm -rf ./out-2/test.sol && rm -rf ./out-2/*.t.sol && rm -rf ./out-2/Mock*.sol && find ./out-2 -name '*.metadata.json' -delete && pnpm run typechain && bob-tsm build.ts",
Expand Down
12 changes: 6 additions & 6 deletions script/js/buildAddressJsonFile.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,16 @@ import { readFile, writeFile } from "fs/promises";
* get published to npm.
*/

const allowedEnv = ["preview", "staging", "mainnet"] as const;
const supportedNetworks = ["goerli", "mainnet"] as const;

const SOUND_ENV = process.env.SOUND_ENV as typeof allowedEnv[number] | undefined;
const EVM_NETWORK = process.env.EVM_NETWORK as typeof supportedNetworks[number] | undefined;

if (!SOUND_ENV || !allowedEnv.includes(SOUND_ENV)) {
console.log("Must specify SOUND_ENV: " + allowedEnv.join(" | "));
if (!EVM_NETWORK || !supportedNetworks.includes(EVM_NETWORK)) {
console.log("Must specify EVM_NETWORK: " + supportedNetworks.join(" | "));
process.exit(1);
}

const chainId = SOUND_ENV == "staging" || SOUND_ENV == "preview" ? 5 : 1;
const chainId = EVM_NETWORK == "mainnet" ? 1 : 5;

async function buildAddressJsonFile() {
const parsedData = await readFile(`broadcast/Deploy.s.sol/${chainId}/run-latest.json`, "utf8").then<{
Expand All @@ -32,7 +32,7 @@ async function buildAddressJsonFile() {
return acc;
}, {});

const filePath = `src/json/${SOUND_ENV}.json`;
const filePath = `src/json/${EVM_NETWORK}.json`;
await ensureFile(filePath);
await writeFile(filePath, JSON.stringify(addresses, null, 2), {});

Expand Down
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import staging from "./json/staging.json";
import preview from "./json/preview.json";
import goerli from "./json/goerli.json";
import mainnet from "./json/mainnet.json";
import { interfaceIds } from "./interfaceIds";

const contractAddresses = {
staging,
preview,
goerli,
mainnet,
} as const;

export { interfaceIds, contractAddresses };
10 changes: 10 additions & 0 deletions src/json/goerli.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"soundFeeRegistry": "0x52036f39c309a877307cc5abc2f9bd77b2d76eb6",
"goldenEggMetadata": "0x3ad47ee14651a0b9206da858e9a845379ccbe69e",
"fixedPriceSignatureMinter": "0x9bdb780adc351f193e2e5db524feef0fdc46fcfc",
"merkleDropMinter": "0xca6df03fc390e3e8fd5846e34de6899ced9a1a88",
"rangeEditionMinter": "0x8990fe778ad96f8121afe5a236de2262350ebf6e",
"editionMaxMinter": "0xa33f01bb3b022238914587be1589c089afccdd83",
"soundEditionV1": "0xbead69ebfdcc209df4d5566cb288d854da544a6d",
"soundCreatorV1": "0x308138ae484b7bbb6c7d337d67a4e7e4e196ce98"
}
10 changes: 10 additions & 0 deletions src/json/mainnet.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
{
"soundFeeRegistry": "",
"goldenEggMetadata": "",
"fixedPriceSignatureMinter": "",
"merkleDropMinter": "",
"rangeEditionMinter": "",
"editionMaxMinter": "",
"soundEditionV1": "",
"soundCreatorV1": ""
}
10 changes: 0 additions & 10 deletions src/json/preview.json

This file was deleted.

10 changes: 0 additions & 10 deletions src/json/staging.json

This file was deleted.