Skip to content

Smart contracts, web3 frontends, tests, and Forge projects for Astria.

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT
Notifications You must be signed in to change notification settings

astriaorg/astria-web3

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

39 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Astria web3

This repository contains smart contracts and front end interfaces for the Astria Shared Sequencer.

Make sure you have the following installed:

Then, clone the repo using the --recurse-submodules flag to bring in all the submodules.

git clone --recurse-submodules git@github.com:astriaorg/astria-web3.git
cd astria-web3

Install dependencies

npm install -g dotenv-cli
curl -L https://foundry.paradigm.xyz | bash

For local dev, make sure the Astria Dev Cluster is running. Then deploy contracts in the following order:

weth9

By default, the just create-weth9 command will pull environment variables from the .env file. If you have deployed your own rollup in the dev cluster, you should replace the arguments in the just command with the rollup name and chain id you used for that deployment.

cd packages/weth9
cp .env.example .env
just create-weth9 <optional-rollupName> <optional-privateKey>

Upon completion, the following output will be shown (the addresses will be different):

Deployer: 0xaC21B97d35Bf75A7dAb15f35b121a50e78A72F30
Deployed to: 0xA53639fB5458e65E4fA917FF951C390292C24A15
Transaction hash: 0x775c63649c25d7b8029e2e786e001fcda1618723a305c2e384d5cae453a32ad7

Copy the Deployed to: address to use for deploying Uniswap.

Uniswap V3

Before deploying Uniswap, make sure that you have ran the weth9 steps above.

cd packages/uniswapv3
cp .env.example .env

Open the .env file and replace the WETH9_ADDRESS= with the address from the weth9 "Deployed to:" output. Install the base64 contract.

npm install
dotenv -- bash -c 'RUST_LOG=debug forge script script/DeployUniswapV3.s.sol:DeployUniswapV3 \
  --optimizer-runs 2 \
  --private-key $PRIVATE_KEY \
  --rpc-url $JSON_RPC \
  --chain-id 912559 \
  --slow \
  --broadcast --skip-simulation -vvvvv'

Generate Transactions

By default, the just generate-transactions command will pull environment variables from the .env file. If you have deployed your own rollup in the dev cluster, you should replace the arguments in the just command with the rollup name and chain id you used for that deployment.

cd packages/evm-test-data
cp .env.example .env
just generate-transactions <optional-rollupName> <optional-chainId> <optional-privateKey>

Running Forge Tests

cd packages/package-you-want-to-test
forge test --rpc-url http://executor.astria.localdev.me

About

Smart contracts, web3 frontends, tests, and Forge projects for Astria.

Resources

License

Apache-2.0, MIT licenses found

Licenses found

Apache-2.0
LICENSE-APACHE
MIT
LICENSE-MIT

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published