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

Example One Click Deployer #240

Closed
wants to merge 6 commits into from
Closed

Example One Click Deployer #240

wants to merge 6 commits into from

Conversation

nitaliano
Copy link
Collaborator

@nitaliano nitaliano commented Apr 5, 2024

Description

This is a very slimmed down version of what the MVP for a 1 click deployer could look like and it's just built against anvil for now. This just shows how we can connect a github action to our dapp console api that can communicate with a Create2Factory deployer that we have onchain that will allow us to deploy any contract just based on it's bytecode and initialization arguments.

Example Action Interface for an ERC20

name: Deploy Contracts

jobs:
  deploy-erc20:
    runs-on: ubuntu-latest
    steps:
      - name: Checkout
        uses: actions/checkout@v3
      - name: Set up foundry
        uses: foundry-rs/foundry-toolchain@v1
      - name: Build Contract Artifacts
        run: pnpm nx run @eth-optimism/contracts-ecosystem:compile
        shell: bash
      - name: Deploy Simple ERC20
        uses: ./apps/dapp-console-api/src/actions   
        with:
          args: Example,exa,18
          target: ./packages/contracts-ecosystem/src/SimpleERC20.sol:SimpleERC20
          buildDir: ./packages/contracts-ecosystem/out
          version: 1.0

MVP using a database to store deployment info
Screenshot 2024-04-05 at 3 21 00 PM

MVP using a EAS to store deployment info
Screenshot 2024-04-05 at 3 23 12 PM

Upgradability
This PR doesn't have anything regarding upgradability. I did explore what we need to do and will add more about this in our scoping document. All we'll need to do is update the Create2Factory to also deploy a proxy contract so we can always add a new implemention contract to it. Generally I think we would use an already existing ERC1967Factory that would allow us to deploy a proxy contract alongside the initial implementation contract. This will require contracts that want upgradability to not have a constructor and instead have an initalize function that we end up calling after deployment with the initialization arguments supplied in the action.

Copy link

netlify bot commented Apr 5, 2024

Deploy Preview for storybook-component-library canceled.

Name Link
🔨 Latest commit cc6a69c
🔍 Latest deploy log https://app.netlify.com/sites/storybook-component-library/deploys/66100f58023cb10008e859ee

Copy link

netlify bot commented Apr 5, 2024

Deploy Preview for op-dapp-console-preview failed. Why did it fail? →

Name Link
🔨 Latest commit cc6a69c
🔍 Latest deploy log https://app.netlify.com/sites/op-dapp-console-preview/deploys/66100f58b584340008c16534

Copy link

Deploying superchain-paymaster-nft-mint-example with  Cloudflare Pages  Cloudflare Pages

Latest commit: cc6a69c
Status: ✅  Deploy successful!
Preview URL: https://92783b5b.superchain-paymaster-nft-mint-example.pages.dev
Branch Preview URL: https://nick-deployer.superchain-paymaster-nft-mint-example.pages.dev

View logs


import {StdUtils} from "forge-std/StdUtils.sol";

contract Create2Factory {
Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is just for an example we should never actually use this contract without adding real safety/auth logic to it

@nitaliano
Copy link
Collaborator Author

Closing this out since it was part of our hackathon. We'll be using this as a reference going forward.

@nitaliano nitaliano closed this Apr 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant