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

feat: deploy to Linea #18

Merged
merged 1 commit into from
Nov 1, 2024
Merged

feat: deploy to Linea #18

merged 1 commit into from
Nov 1, 2024

Conversation

richard-ramos
Copy link
Member

@richard-ramos richard-ramos commented Oct 1, 2024

  • Splits deployment script in separate deployments per contract (since we might want in the future to deploy different PriceCalculators or WakuRLNV2 contracts).
  • Adds https://github.com/Cyfrin/foundry-devops to retrieve the latest address deployed. (Useful when using multiple scripts)
  • Adds separate package.json scripts to control the deployment of each individual contract
  • Setups the deployment for Linea Sepolia


function run() public broadcast returns (address) {
address priceCalcAddr = DevOpsTools.get_most_recent_deployment("LinearPriceCalculator", block.chainid);
address wakuRlnV2ImplAddr = DevOpsTools.get_most_recent_deployment("WakuRlnV2", block.chainid);

Choose a reason for hiding this comment

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

This is cool, but what happens when you don't have a broadcast directory with a previous deployment on your machine?

Copy link
Member Author

Choose a reason for hiding this comment

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

Hm, good point.
I'll change the script to allow the usage of environment variables and/or indicate you want to use the broadcast directory.

Copy link
Member Author

@richard-ramos richard-ramos Oct 7, 2024

Choose a reason for hiding this comment

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

Change implemented in a5acb1d
Now it will by default use the broadcast dir, unless env variables are used for contracts that were already deployed.

@richard-ramos richard-ramos force-pushed the feat/membership-notrack branch 4 times, most recently from 2b1600a to 6db38e3 Compare October 7, 2024 20:02
Base automatically changed from feat/membership-notrack to feat/membership October 8, 2024 12:58
@fryorcraken
Copy link

I think deployment on Linea testnet is fine.

However, we should have a specific issue to plan and track switching TWN from Ethereum Sepolia to Linea testnet. cc @jm-clius @s-tikhomirov

@jm-clius
Copy link

However, we should have a specific issue to plan and track switching TWN from Ethereum Sepolia to Linea testnet

Spoke briefly about this with @s-tikhomirov. We'll create an issue in pm-repo that tracks the steps to get to Linea (mainnet). This will require some thinking, but the steps may look something like this:

  1. Deploy contract to a testnet (either Sepolia or Linea Sepolia).
  2. Test with some test version of nwaku or nwaku-compose (we don't want to switch everyone without proper registration tools)
  3. Update RLN membership registration tools to work with new contract, allowing users to pay for the rate they want.
  4. Switch TWN to this version of the testnet contract (by changing nwaku-compose) and announce to ensure everyone upgrades
  5. (after some time/tests) Deploy to Linea mainnet and update TWN accordingly (this does not have to be a production version yet, as Linea mainnet may require some testing from our side).

cc @s-tikhomirov

@richard-ramos
Copy link
Member Author

richard-ramos commented Oct 20, 2024

I've deployed the contracts including changes proposed on PR #22 :

0xb9cd878c90e49f797b4431fbf4fb333108cb90e6

For ease of test, I'm using the following test token that can be minted by anyone:
0x185A0015aC462a0aECb81beCc0497b649a64B9ea

cc: @Ivansete-status

@jm-clius
Copy link

Some suggested next steps set out here: waku-org/pm#258

Base automatically changed from feat/membership to main October 23, 2024 16:22
@richard-ramos
Copy link
Member Author

@s-tikhomirov @0x-r4bbit I think this PR should be fine to merge once conflicts are fixed, right?

script/Deploy.s.sol Outdated Show resolved Hide resolved
Comment on lines 153 to 155
require(0 < _minMembershipRateLimit);
require(_minMembershipRateLimit <= _maxMembershipRateLimit);
require(_maxMembershipRateLimit <= _maxTotalRateLimit);
require(_activeDurationForNewMemberships > 0);
Copy link
Contributor

Choose a reason for hiding this comment

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

Perhaps we should follow the linter's advice and add error messages here?

Copy link
Member Author

Choose a reason for hiding this comment

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

Not sure if worth it. These are checks that will be executed only during deployment. It's highly likely that we'll be using values hardcoded in the deploy script that will never hit these requires (like we do now).

@richard-ramos richard-ramos merged commit e46ce5a into main Nov 1, 2024
4 checks passed
@richard-ramos richard-ramos deleted the linea branch November 1, 2024 14:23
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.

5 participants