diff --git a/README.md b/README.md index 05427d9..d04a811 100644 --- a/README.md +++ b/README.md @@ -1,4 +1,4 @@ -# 🚢 Ship Yard Cohort Website +# 📺 BG Media Cohort We're running an experiment to fund focused, high-leverage open-source work by providing streams to builders rewarding them for their ongoing contributions to BuidlGuidl and the Ethereum Ecosystem. @@ -6,7 +6,7 @@ Our emphasis is on quality over quantity, striving for well-crafted products. Ou This initiative is made possible by BuidlGuidl! -Read more at the [F.A.Q](https://shipyard.buidlguidl.com/faq) +Read more at the [F.A.Q](https://media.buidlguidl.com/faq) --- @@ -17,13 +17,14 @@ Read more at the [F.A.Q](https://shipyard.buidlguidl.com/faq) - [Deploying your Smart Contracts to a Live Network](#Deploying-your-Smart-Contracts-to-a-live-network) - [Deploying your NextJS App](#Deploying-your-NextJS-App) - [Disabling Type & Linting Error Checks](#Disabling-type-and-linting-error-checks) - * [Disabling commit checks](#Disabling-commit-checks) - * [Deploying to Vercel without any checks](#Deploying-to-Vercel-without-any-checks) - * [Disabling Github Workflow](#Disabling-Github-Workflow) + - [Disabling commit checks](#Disabling-commit-checks) + - [Deploying to Vercel without any checks](#Deploying-to-Vercel-without-any-checks) + - [Disabling Github Workflow](#Disabling-Github-Workflow) ## Requirements Before you begin, you need to install the following tools: + - [Node (v18 LTS)](https://nodejs.org/en/download/) - [Yarn (v1.x)](https://classic.yarnpkg.com/en/docs/install/) - [Git](https://git-scm.com/downloads) @@ -33,9 +34,10 @@ Before you begin, you need to install the following tools: We are using Ponder for indexing cohorts events (adding builders, withdrawals, etc). Check out the [BG Ponder instance](https://github.com/BuidlGuidl/bg-ponder-indexer) for more information. You have 3 options: + 1. Run your own Ponder instance (configure the URL in `packages/nextjs/_app.tsx`) 2. Use the BG Ponder instance (make a [PR](https://github.com/BuidlGuidl/bg-ponder-indexer) with your cohorts contract address) -3. Rollback to fetching events with SE-2 hooks (check out PRs [#6](https://github.com/BuidlGuidl/shipyard.buidlguidl.com/pull/6) and [#7](https://github.com/BuidlGuidl/shipyard.buidlguidl.com/pull/7)) +3. Rollback to fetching events with SE-2 hooks (check out PRs [#6](https://github.com/BuidlGuidl/media.buidlguidl.com/pull/6) and [#7](https://github.com/BuidlGuidl/media.buidlguidl.com/pull/7)) ## Quickstart @@ -45,7 +47,7 @@ To get started follow the steps below: ``` git clone https://github.com/buidlguidl/.git -cd shipyard.buidlguidl.com +cd media.buidlguidl.com yarn install ``` @@ -54,13 +56,15 @@ yarn install ``` yarn start ``` -Visit your app on: `http://localhost:3000`. + +Visit your app on: `http://localhost:3000`. --- -If you want to test the contract locally, you can do so by following steps 3 and 4. +If you want to test the contract locally, you can do so by following steps 3 and 4. Remember to tweak the app config in `packages/nextjs/scaffold.config.ts`: + - Point it to the local network (`chains.hardhat`) - Update the contracts fromBlock to `0` @@ -77,19 +81,21 @@ This command starts a local Ethereum network using Hardhat. The network runs on ``` yarn deploy ``` -This command deploys a test smart contract to the local network. The contract is located in `packages/hardhat/contracts` and can be modified to suit your needs. The `yarn deploy` command uses the deploy script located in `packages/hardhat/deploy` to deploy the contract to the network. You can also customize the deploy script. +This command deploys a test smart contract to the local network. The contract is located in `packages/hardhat/contracts` and can be modified to suit your needs. The `yarn deploy` command uses the deploy script located in `packages/hardhat/deploy` to deploy the contract to the network. You can also customize the deploy script. ## Deploying your Smart Contracts to a Live Network + Once you are ready to deploy your smart contracts, there are a few things you need to adjust. 1. Select the network -By default, ```yarn deploy``` will deploy the contract to the local network. You can change the defaultNetwork in `packages/hardhat/hardhat.config.js.` You could also simply run ```yarn deploy --network target_network``` to deploy to another network. +By default, `yarn deploy` will deploy the contract to the local network. You can change the defaultNetwork in `packages/hardhat/hardhat.config.js.` You could also simply run `yarn deploy --network target_network` to deploy to another network. Check the `hardhat.config.js` for the networks that are pre-configured. You can also add other network settings to the `hardhat.config.js file`. Here are the [Alchemy docs](https://docs.alchemy.com/docs/how-to-add-alchemy-rpc-endpoints-to-metamask) for information on specific networks. Example: To deploy the contract to the Sepolia network, run the command below: + ``` yarn deploy --network sepolia ``` @@ -103,7 +109,7 @@ DEPLOYER_PRIVATE_KEY="" The deployer account is the account that will deploy your contracts. Additionally, the deployer account will be used to execute any function calls that are part of your deployment script. -You can generate a random account / private key with ```yarn generate``` or add the private key of your crypto wallet. ```yarn generate``` will create a random account and add the DEPLOYER_PRIVATE_KEY to the .env file. You can check the generated account with ```yarn account```. +You can generate a random account / private key with `yarn generate` or add the private key of your crypto wallet. `yarn generate` will create a random account and add the DEPLOYER_PRIVATE_KEY to the .env file. You can check the generated account with `yarn account`. 3. Deploy your smart contract(s) @@ -132,10 +138,12 @@ If you want to redeploy to the same production URL you can run `yarn vercel --pr **Hint**: We recommend connecting the project GitHub repo to Vercel so you the gets automatically deployed when pushing to `main` ## Disabling type and linting error checks + > **Hint** > Typescript helps you catch errors at compile time, which can save time and improve code quality, but can be challenging for those who are new to the language or who are used to the more dynamic nature of JavaScript. Below are the steps to disable type & lint check at different levels ### Disabling commit checks + We run `pre-commit` [git hook](https://git-scm.com/book/en/v2/Customizing-Git-Git-Hooks) which lints the staged files and don't let you commit if there is an linting error. To disable this, go to `.husky/pre-commit` file and comment out `yarn lint-staged --verbose` @@ -146,14 +154,17 @@ To disable this, go to `.husky/pre-commit` file and comment out `yarn lint-stage ``` ### Deploying to Vercel without any checks + Vercel by default runs types and lint checks while developing `build` and deployment fails if there is a types or lint error. To ignore types and lint error checks while deploying, use : + ```shell yarn vercel:yolo ``` ### Disabling Github Workflow -We have github workflow setup checkout `.github/workflows/lint.yaml` which runs types and lint error checks every time code is __pushed__ to `main` branch or __pull request__ is made to `main` branch + +We have github workflow setup checkout `.github/workflows/lint.yaml` which runs types and lint error checks every time code is **pushed** to `main` branch or **pull request** is made to `main` branch To disable it, **delete `.github` directory** diff --git a/packages/hardhat/deploy/00_deploy_your_contract.ts b/packages/hardhat/deploy/00_deploy_your_contract.ts index 49f5d8e..75bb174 100644 --- a/packages/hardhat/deploy/00_deploy_your_contract.ts +++ b/packages/hardhat/deploy/00_deploy_your_contract.ts @@ -1,5 +1,5 @@ -import { builderList } from "../../../builderList"; -import { ethers } from "ethers"; +// import { builderList } from "../../../builderList"; +// import { ethers } from "ethers"; import { DeployFunction } from "hardhat-deploy/types"; import { HardhatRuntimeEnvironment } from "hardhat/types"; @@ -35,11 +35,11 @@ const deployYourContract: DeployFunction = async function (hre: HardhatRuntimeEn const yourContract = await hre.ethers.getContract("CohortStreams", deployer); - console.log("🫡 adding batch of builders"); - const builderStakes = Array(builderList.length).fill(ethers.utils.parseEther("1.5")); - await yourContract.addBatch(builderList, builderStakes); + // console.log("🫡 adding batch of builders"); + // const builderStakes = Array(builderList.length).fill(ethers.utils.parseEther("1.5")); + // await yourContract.addBatch(builderList, builderStakes); - await yourContract.transferOwnership(builderList[0]); + await yourContract.transferOwnership("0x11E91FB4793047a68dFff29158387229eA313ffE"); }; export default deployYourContract; diff --git a/packages/nextjs/generated/hardhat_contracts.ts b/packages/nextjs/generated/hardhat_contracts.ts index 793a3ce..58c8a20 100644 --- a/packages/nextjs/generated/hardhat_contracts.ts +++ b/packages/nextjs/generated/hardhat_contracts.ts @@ -5,7 +5,312 @@ export default { chainId: "10", contracts: { CohortStreams: { - address: "0x55cb9cb337cdb0a41cac89ffac4627744b50b566", + address: "0xa6EfA453c25658F725590A5821Cf408818f25FEf", + abi: [ + { + inputs: [], + stateMutability: "nonpayable", + type: "constructor", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "AddBuilder", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "previousOwner", + type: "address", + }, + { + indexed: true, + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "OwnershipTransferred", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + ], + name: "UpdateBuilder", + type: "event", + }, + { + anonymous: false, + inputs: [ + { + indexed: true, + internalType: "address", + name: "to", + type: "address", + }, + { + indexed: false, + internalType: "uint256", + name: "amount", + type: "uint256", + }, + { + indexed: false, + internalType: "string", + name: "reason", + type: "string", + }, + ], + name: "Withdraw", + type: "event", + }, + { + stateMutability: "payable", + type: "fallback", + }, + { + inputs: [ + { + internalType: "address[]", + name: "_builders", + type: "address[]", + }, + { + internalType: "uint256[]", + name: "_caps", + type: "uint256[]", + }, + ], + name: "addBatch", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address payable", + name: "_builder", + type: "address", + }, + { + internalType: "uint256", + name: "_cap", + type: "uint256", + }, + ], + name: "addBuilderStream", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address[]", + name: "_builders", + type: "address[]", + }, + ], + name: "allBuildersData", + outputs: [ + { + components: [ + { + internalType: "address", + name: "builderAddress", + type: "address", + }, + { + internalType: "uint256", + name: "cap", + type: "uint256", + }, + { + internalType: "uint256", + name: "unlockedAmount", + type: "uint256", + }, + ], + internalType: "struct CohortStreams.BuilderData[]", + name: "", + type: "tuple[]", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "frequency", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "owner", + outputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [], + name: "renounceOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "uint256", + name: "_amount", + type: "uint256", + }, + { + internalType: "string", + name: "_reason", + type: "string", + }, + ], + name: "streamWithdraw", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "", + type: "address", + }, + ], + name: "streamedBuilders", + outputs: [ + { + internalType: "uint256", + name: "cap", + type: "uint256", + }, + { + internalType: "uint256", + name: "last", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "newOwner", + type: "address", + }, + ], + name: "transferOwnership", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + inputs: [ + { + internalType: "address", + name: "_builder", + type: "address", + }, + ], + name: "unlockedBuilderAmount", + outputs: [ + { + internalType: "uint256", + name: "", + type: "uint256", + }, + ], + stateMutability: "view", + type: "function", + }, + { + inputs: [ + { + internalType: "address payable", + name: "_builder", + type: "address", + }, + { + internalType: "uint256", + name: "_cap", + type: "uint256", + }, + ], + name: "updateBuilderStreamCap", + outputs: [], + stateMutability: "nonpayable", + type: "function", + }, + { + stateMutability: "payable", + type: "receive", + }, + ], + }, + }, + }, + ], + 31337: [ + { + name: "localhost", + chainId: "31337", + contracts: { + CohortStreams: { + address: "0xCf7Ed3AccA5a467e9e704C703E8D87F634fB0Fc9", abi: [ { inputs: [], diff --git a/packages/nextjs/pages/faq.tsx b/packages/nextjs/pages/faq.tsx index c3a3b15..41e9b45 100644 --- a/packages/nextjs/pages/faq.tsx +++ b/packages/nextjs/pages/faq.tsx @@ -7,27 +7,25 @@ const Faq = () => {
-

What is the BG Ship Yard?

+

What is BG Media?

- The BG Ship Yard is an initiative by BuidlGuidl aimed at funding focused, high-leverage open-source - projects. By providing a monthly UBI to handpicked developers, we support ongoing contributions to the - BuidlGuidl and the Ethereum ecosystem. + BG Media is an initiative by BuidlGuidl aimed at funding focused, high-leverage open-source projects. By + providing a monthly UBI to handpicked developers, we support ongoing contributions to the BuidlGuidl and the + Ethereum ecosystem.

-

- What is the difference between the BuidlGuidl and the BG Ship Yard? -

+

What is the difference between the BuidlGuidl and BG Media?

- The BG Ship Yard is just a working group inside the BuidlGuidl community. Maintaining the spirit of the - BuidlGuidl – learning and experimentation – the BG Ship Yard adds intentionality, a focus on quality, and - commits to delivering complete projects. + BG Media is just a working group inside the BuidlGuidl community. Maintaining the spirit of the BuidlGuidl – + learning and experimentation – BG Media adds intentionality, a focus on quality, and commits to delivering + complete projects.

-

What are the core values of the BG Ship Yard?

+

What are the core values of BG Media?

-

How can I join the BG Ship Yard?

-

There is no single path or application process to join the BG Ship Yard.

+

How can I join BG Media?

+

There is no single path or application process to join BG Media.

Members are usually part of the BuidlGuidl or participant in any of the project-focused cohorts, and have proven their ability to consistently deliver value and align with our core values. @@ -57,11 +55,11 @@ const Faq = () => { Streams represent the MAX amount that a developer can withdraw each month. When full, it doesn't recharge until a withdrawal is made.

-

Developers can withdraw from their stream when working on any of the BG Ship Yard's projects.

+

Developers can withdraw from their stream when working on any of BG Media's projects.

Who is funding this initiative?

-

The BG Ship Yard is funded by the BuidlGuidl.

+

BG Media is funded by the BuidlGuidl.

diff --git a/packages/nextjs/pages/members.tsx b/packages/nextjs/pages/members.tsx index 4247a3e..e13f9bb 100644 --- a/packages/nextjs/pages/members.tsx +++ b/packages/nextjs/pages/members.tsx @@ -50,8 +50,8 @@ const Members: NextPage = () => {

Members

- These are the BG Ship Yard active builders and their streams. You can click on any builder to see their - detailed contributions. + These are the BG Media active builders and their streams. You can click on any builder to see their detailed + contributions.

{isLoadingBuilderData || isLoadingBuilderEvents ? (
diff --git a/packages/nextjs/pages/projects.tsx b/packages/nextjs/pages/projects.tsx index 8543a07..d188a69 100644 --- a/packages/nextjs/pages/projects.tsx +++ b/packages/nextjs/pages/projects.tsx @@ -8,18 +8,10 @@ import { useCohortWithdrawEvents } from "~~/hooks/useCohortWithdrawEvents"; const projects = [ { - name: "Hacked Wallet Recovery", - description: - "We built this to make it super easy for victims of hacks to recover any remaining assets in their wallet without getting swept by the attacker.", - link: "https://hackedwalletrecovery.com", - github: "https://github.com/BuidlGuidl/flashbot-recovery-bundler", - }, - { - name: "Impact Calculator", - description: - "This was a prototype that was built to facilitate the needs of Optimism in helping them figure out a new impact-led direction in their RetroPGF rounds.", - link: "https://impact-calculator.vercel.app", - github: "https://github.com/BuidlGuidl/impact-calculator", + name: "BG Media, publications, and designs", + description: "", + link: "", + github: "", }, ];