Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
114 commits
Select commit Hold shift + click to select a range
cb67154
block bridge function (#49)
albbm Oct 13, 2025
f060b66
Merge pull request #14 from okx/sync/develop
louisliu2048 Oct 13, 2025
0f278bf
Xiong/update op geth (#50)
louisliu2048 Oct 13, 2025
caea018
Merge branch 'dev' into pre-release
Oct 13, 2025
cf88670
update image tag info
Oct 13, 2025
f76ba63
revert the change name of var DeployV2DisputeGamesDevFlag
Oct 13, 2025
0918c48
update env image tag (#53)
louisliu2048 Oct 13, 2025
a5f7f94
merge dev and fix conflict
Oct 13, 2025
5326215
rm unused code
Oct 13, 2025
45e08e0
Add CGT (#52)
doutv Oct 13, 2025
97a978d
feat: add custom gas token configuration for OKB (#55)
doutv Oct 13, 2025
b468498
update docker file to use the right image version (#56)
louisliu2048 Oct 13, 2025
b0c412e
Merge branch 'dev' into pre-release
Oct 13, 2025
4277650
consolidate test scripts
cliff0412 Oct 14, 2025
fd6398c
refactor
cliff0412 Oct 14, 2025
340b652
Merge branch 'pre-release' into testnet_migration
cliff0412 Oct 14, 2025
e256231
resolve conflicts
cliff0412 Oct 14, 2025
2146987
fix build op contracts
cliff0412 Oct 14, 2025
d70b357
fix op_stack image build
cliff0412 Oct 14, 2025
33c4c1a
use dev for op-geth
cliff0412 Oct 14, 2025
c39c3f5
Support GnosisSafe (#57)
KyrinCode Oct 14, 2025
68a0dea
fix setGasToken
cliff0412 Oct 14, 2025
dd072a2
remove SystemConfig UpdateType GAS_PAYING_TOKEN event
doutv Oct 14, 2025
78393c3
Update MockOKB contract to mint a total supply of 660,000
doutv Oct 14, 2025
b11f774
refactoring
cliff0412 Oct 14, 2025
d9f11cd
Merge remote-tracking branch 'origin/testnet_migration' into testnet_…
cliff0412 Oct 14, 2025
d902be4
Separate MockOKB and setupCGT into 2 scripts
doutv Oct 14, 2025
3a0d7e9
Enhance cgt-only-contract.sh for improved OKB token handling
doutv Oct 14, 2025
70b82ee
Add require statement for gas token address validation in SetupCustom…
doutv Oct 14, 2025
244a801
Update example.env to include OKB token address configuration
doutv Oct 14, 2025
7df7b49
Refactor Custom Gas Token setup and verification scripts
doutv Oct 14, 2025
dffc9be
fix typo
doutv Oct 14, 2025
13cacd7
fix sysconfig
cliff0412 Oct 14, 2025
f6bfa4c
Merge branch 'testnet_migration' of github.com:okx/optimism into test…
cliff0412 Oct 14, 2025
41a74ba
refactoring
cliff0412 Oct 14, 2025
ad831e6
Update MockOKB contract to mint a total supply of 660,000 (#60)
doutv Oct 14, 2025
d24d6b9
add patch
cliff0412 Oct 14, 2025
afd0281
Remove SystemConfig UpdateType GAS_PAYING_TOKEN event. gasPayingToken…
doutv Oct 15, 2025
a02942d
fix: build image sequence
Oct 15, 2025
2b7cd75
feat: add cdk image env
Oct 15, 2025
02c901f
feat: set ARCH to default value using docker cmd
Oct 15, 2025
e0c8eb3
update testnet genesisGasParameters and readme
cliff0412 Oct 15, 2025
ec6dca7
Merge branch 'testnet_migration' of github.com:okx/optimism into test…
cliff0412 Oct 15, 2025
ebc1fc2
use gopath for install go bin
cliff0412 Oct 15, 2025
f3f868e
Update Dockerfile and .dockerignore for improved build process
doutv Oct 15, 2025
e089378
refine okbAdapter contract
albbm Oct 15, 2025
06bc178
Optimize opstack Dockerfile build time
doutv Oct 15, 2025
91e3024
Refactor output handling in setup_cgt function
doutv Oct 15, 2025
5b17a11
Update console log output in SetupCustomGasToken script
doutv Oct 15, 2025
8eea8b6
Update environment configuration in test script
doutv Oct 15, 2025
4fa4c8d
Merge remote-tracking branch 'origin/pre-release' into fix/cgt-contract
doutv Oct 15, 2025
2430a94
Remove duplicate balanceOf function from IOKB interface
albbm Oct 15, 2025
199b7d0
fix script
doutv Oct 15, 2025
f93104e
Merge branch 'fix/cgt-contract' into review/cgt-contract
doutv Oct 15, 2025
95e3ffe
Revert "Merge branch 'dev' into pre-release"
doutv Oct 15, 2025
85b5250
forge fmt
doutv Oct 15, 2025
d6a29f7
Optimize dockerfile build time (#63)
doutv Oct 15, 2025
efc65e6
fix batcher proposer configs (#61)
KyrinCode Oct 15, 2025
042af4b
Merge branch 'dev' into pre-release
Oct 15, 2025
4dce6d8
update op-geth to the latest
Oct 15, 2025
9c5ba7c
add cgt_enable (#66)
cliff0412 Oct 15, 2025
5ba352b
Optimize dockerfile build time (#63)
doutv Oct 15, 2025
874ee68
Update testnet readme steps
Vui-Chee Oct 16, 2025
f2e23d1
Add read access for test configuration directory in foundry.toml Add …
albbm Oct 16, 2025
8b818bf
Refactor DepositedOKBAdapter and introduce ERC20Rescuer contract
doutv Oct 16, 2025
e2a5080
Add new error for invalid gas token in IOptimismPortal2 interface
doutv Oct 16, 2025
c985a09
put migration into separate file
cliff0412 Oct 16, 2025
f2af80b
refactor l1-geth
cliff0412 Oct 16, 2025
d4625e1
merge dev
cliff0412 Oct 16, 2025
b4f8bec
Merge remote-tracking branch 'origin/pre-release' into testnet_migration
cliff0412 Oct 16, 2025
135fe9d
merge with pre-release
cliff0412 Oct 16, 2025
660538e
refactor
cliff0412 Oct 16, 2025
0c207e9
sync op-geth
cliff0412 Oct 16, 2025
4bd32ff
Enhance DepositedOKBAdapter with Whitelist Functionality and Owner Co…
doutv Oct 16, 2025
7b27238
Enhance DepositedOKBAdapter with Transfer Failure Handling
doutv Oct 16, 2025
9c76af5
fix(test): add --legacy flag to Safe contract deployment
Oct 16, 2025
5f14698
update testnet readme for regenesis
Vui-Chee Oct 16, 2025
caf3034
Refactor transfer error handling in DepositedOKBAdapter
doutv Oct 16, 2025
cf5ed5b
Add comprehensive tests for DepositedOKBAdapter functionality
doutv Oct 16, 2025
2c6ab9b
fix issues and refactor add peers (#69)
KyrinCode Oct 16, 2025
1995d59
Merge branch 'dev' into pre-release
Oct 16, 2025
9f00e64
consolidate test scripts (#59)
cliff0412 Oct 16, 2025
866c18e
support gnosis safe and fix configs
KyrinCode Oct 16, 2025
39ab3a6
refactor geth_cmd
cliff0412 Oct 17, 2025
3701bea
Merge remote-tracking branch 'origin/pre-release' into testnet_migration
cliff0412 Oct 17, 2025
718d5f2
Update Dockerfile to use latest op-contracts image
doutv Oct 17, 2025
2896cb3
Refactor SetupCustomGasToken script to remove OKBBurner implementation
doutv Oct 17, 2025
40eee59
Merge pull request #71 from okx/kyrin/support-gnosis-safe-and-fix-con…
cliff0412 Oct 17, 2025
951a306
no verify for redeploy testnet, temparay
cliff0412 Oct 17, 2025
b676c86
Merge pull request #70 from okx/fix/okb-adapter
doutv Oct 17, 2025
4ecb082
Merge pull request #72 from okx/testnet_migration
cliff0412 Oct 17, 2025
6017e90
custom dockerfile to build op-geth-migrate
Vui-Chee Oct 17, 2025
ea7dd32
Update testnet migration readme
Vui-Chee Oct 17, 2025
3e70bcf
add pp proxy
cliff0412 Oct 17, 2025
bce3cac
Merge branch 'testnet_migration' of github.com:okx/optimism into test…
cliff0412 Oct 17, 2025
86f68c6
Merge pull request #73 from okx/testnet_migration
cliff0412 Oct 17, 2025
9f18e45
rm testnet.env
cliff0412 Oct 17, 2025
9f6441d
rm testnetenv
cliff0412 Oct 17, 2025
5685f02
Merge pull request #74 from okx/testnet_migration
cliff0412 Oct 17, 2025
25c6778
change address
cliff0412 Oct 17, 2025
3a62ff0
Merge pull request #75 from okx/testnet_migration
cliff0412 Oct 17, 2025
71cffee
update parameters
cliff0412 Oct 17, 2025
b574257
change fee receipt address
cliff0412 Oct 17, 2025
22f543d
Add tests for depositERC20Transaction in OptimismPortal2
doutv Oct 17, 2025
d6c4e87
Merge pull request #77 from okx/testnet_migration
zjg555543 Oct 17, 2025
5dd3108
Merge pull request #78 from okx/feat/add-cgt-contract-test
doutv Oct 17, 2025
5ba027e
forge fmt
doutv Oct 17, 2025
2abdab0
Merge remote-tracking branch 'origin/pre-release' into review/cgt-con…
doutv Oct 17, 2025
aeb3b51
add OKB mainnet address
doutv Oct 17, 2025
003b931
Refactor DepositedOKBAdapter to clarify token minting and transfer re…
doutv Oct 17, 2025
a2acfcd
fix lint
doutv Oct 17, 2025
bc799a8
fix rescueERC20 transfer logic
albbm Oct 20, 2025
4a23bb9
forge fmt
doutv Oct 20, 2025
4602267
Add MockUSDT contract and tests for USDT rescue functionality
doutv Oct 20, 2025
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
53 changes: 42 additions & 11 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -1,13 +1,44 @@
.github
.vscode
# All the files we depend on. We are using a negative pattern to not include anything by accident.
# node_modules, packages (contains git submodules and node modules etc.), devnet dirs etc. all add up a lot.
*

.env
.envrc
**/.env
# Include contracts
!/packages/contracts-bedrock
# Exclude generated files and node modules from contracts
/packages/contracts-bedrock/forge-artifacts
/packages/contracts-bedrock/artifacts
/packages/contracts-bedrock/cache
/packages/contracts-bedrock/broadcast

!/cannon
!/devnet-sdk
!/op-batcher
!/op-chain-ops
!/op-deployer
!/op-dripper
!/op-challenger
!/op-dispute-mon
!/op-conductor
!/op-node
!/op-preimage
!/op-program
!/op-proposer
!/op-service
!/op-supervisor
!/op-test-sequencer
!/op-wheel
!/op-alt-da
!/op-faucet
!/op-interop-mon
!/go.mod
!/go.sum
!/justfiles
!/mise.toml
!/op-e2e/e2eutils
!/op-geth
!Makefile

test
**/*_test.go
build/_workspace
build/bin
build/_bin
tests/testdata
**/bin
**/testdata
**/tests
.env
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -73,3 +73,5 @@ test/tmp
test-apollo/l1-geth
test-apollo/config-op
test-apollo/data

test-pp-op/testnet.env
2 changes: 1 addition & 1 deletion .gitmodules
Original file line number Diff line number Diff line change
Expand Up @@ -35,4 +35,4 @@
[submodule "op-geth"]
path = op-geth
url = https://github.com/okx/op-geth
branch = sync/optimism
branch = dev
9 changes: 8 additions & 1 deletion Dockerfile-contracts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ WORKDIR /app/packages/contracts-bedrock
RUN git submodule update --init --recursive || echo "No submodules found"
RUN --mount=type=cache,target=/root/.foundry \
--mount=type=cache,target=/root/.cache \
forge build
forge build --skip "/**/test/**"

# Build op-deployer
WORKDIR /app
Expand All @@ -42,6 +42,13 @@ RUN --mount=type=cache,target=/root/.cache \
FROM debian:bookworm-slim
WORKDIR /app

# Update certificates
RUN apt-get update && apt-get install -y ca-certificates && update-ca-certificates

# Set environment variables for Go
ENV SSL_CERT_FILE=/etc/ssl/certs/ca-certificates.crt
ENV SSL_CERT_DIR=/etc/ssl/certs

# Copy foundry tools for runtime use
COPY --from=contracts-builder /usr/local/bin/forge /usr/local/bin/cast /usr/local/bin/anvil /usr/local/bin/

Expand Down
4 changes: 2 additions & 2 deletions Dockerfile-opstack
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,10 @@ COPY . .
RUN --mount=type=cache,target=/root/.cache \
--mount=type=cache,target=/root/.cache/go-build \
--mount=type=cache,target=/go/pkg/mod \
make build-go
make build-go-no-submodules

# Copy foundry tools and artifacts from contracts image
COPY --from=op-contracts:v1.13.4 /usr/local/bin/forge /usr/local/bin/cast /usr/local/bin/anvil /usr/local/bin/
COPY --from=op-contracts:latest /usr/local/bin/forge /usr/local/bin/cast /usr/local/bin/anvil /usr/local/bin/

# Verify installations
RUN echo "🔍 Verifying installations:" && \
Expand Down
3 changes: 3 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@ build: build-go build-contracts ## Builds Go components and contracts-bedrock
build-go: submodules op-node op-proposer op-batcher op-challenger op-dispute-mon op-program cannon withdrawal op-conductor ## Builds main Go components
.PHONY: build-go

build-go-no-submodules: op-node op-proposer op-batcher op-challenger op-dispute-mon op-program cannon withdrawal op-conductor ## Used in Dockerfile
.PHONY: build-go-no-submodules

build-contracts:
(cd packages/contracts-bedrock && just build)
.PHONY: build-contracts
Expand Down
2 changes: 1 addition & 1 deletion op-deployer/pkg/deployer/bootstrap/implementations.go
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ func (c *ImplementationsConfig) Check() error {
return errors.New("dispute game finality delay in seconds must be specified")
}
// Check V2 fault game parameters only if V2 dispute games feature is enabled
deployV2Games := deployer.IsDevFeatureEnabled(c.DevFeatureBitmap, deployer.DeployV2DisputeGames)
deployV2Games := deployer.IsDevFeatureEnabled(c.DevFeatureBitmap, deployer.DeployV2DisputeGamesDevFlag)
if deployV2Games {
if c.FaultGameMaxGameDepth == 0 {
return errors.New("fault game max game depth must be specified when V2 dispute games feature is enabled")
Expand Down
4 changes: 2 additions & 2 deletions op-deployer/pkg/deployer/devfeatures.go
Original file line number Diff line number Diff line change
Expand Up @@ -15,8 +15,8 @@ var (
// CannonKonaDevFlag enables Kona as the default cannon prover.
CannonKonaDevFlag = common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000010")

// DeployV2DisputeGames enables deployment of V2 dispute game contracts.
DeployV2DisputeGames = common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000100")
// DeployV2DisputeGamesDevFlag enables deployment of V2 dispute game contracts.
DeployV2DisputeGamesDevFlag = common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000000100")

// CustomGasToken enables the custom gas token.
CustomGasToken = common.HexToHash("0x0000000000000000000000000000000000000000000000000000000000001000")
Expand Down
2 changes: 1 addition & 1 deletion op-devstack/presets/disputegame_v2.go
Original file line number Diff line number Diff line change
Expand Up @@ -7,5 +7,5 @@ import (
)

func WithDisputeGameV2() stack.CommonOption {
return stack.MakeCommon(sysgo.WithDeployerOptions(sysgo.WithDevFeatureBitmap(deployer.DeployV2DisputeGames)))
return stack.MakeCommon(sysgo.WithDeployerOptions(sysgo.WithDevFeatureBitmap(deployer.DeployV2DisputeGamesDevFlag)))
}
1 change: 1 addition & 0 deletions packages/contracts-bedrock/foundry.toml
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,7 @@ fs_permissions = [
{ access='read-write', path='./.testdata/' },
{ access='read', path='./kout-deployment' },
{ access='read', path='./test/fixtures' },
{ access='read', path='../../test/config-op/' },
{ access='read', path='./lib/superchain-registry/superchain/configs/' },
{ access='read', path='./lib/superchain-registry/validation/standard/' },
]
Expand Down
9 changes: 9 additions & 0 deletions packages/contracts-bedrock/interfaces/L1/IOKB.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";

interface IOKB is IERC20, IERC20Metadata {
function triggerBridge() external;
}
11 changes: 11 additions & 0 deletions packages/contracts-bedrock/interfaces/L1/IOptimismPortal2.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,8 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase {
error OptimismPortal_ProofNotOldEnough();
error OptimismPortal_Unproven();
error OptimismPortal_InvalidLockboxState();
error OptimismPortal_OnlyCustomGasToken();
error OptimismPortal_InvalidGasToken();
error OutOfGas();
error UnexpectedList();
error UnexpectedString();
Expand All @@ -49,6 +51,15 @@ interface IOptimismPortal2 is IProxyAdminOwnedBase {
function anchorStateRegistry() external view returns (IAnchorStateRegistry);
function ethLockbox() external view returns (IETHLockbox);
function checkWithdrawal(bytes32 _withdrawalHash, address _proofSubmitter) external view;
function depositERC20Transaction(
address _to,
uint256 _mint,
uint256 _value,
uint64 _gasLimit,
bool _isCreation,
bytes memory _data
)
external;
function depositTransaction(
address _to,
uint256 _value,
Expand Down
4 changes: 4 additions & 0 deletions packages/contracts-bedrock/interfaces/L1/ISystemConfig.sol
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,10 @@ interface ISystemConfig is IProxyAdminOwnedBase {
function setFeature(bytes32 _feature, bool _enabled) external;
function isFeatureEnabled(bytes32) external view returns (bool);
function isCustomGasToken() external view returns (bool);
function gasPayingToken() external view returns (address address_, uint8 decimals_);
function gasPayingTokenName() external view returns (string memory name_);
function gasPayingTokenSymbol() external view returns (string memory symbol_);
function setGasPayingToken(address _token, uint8 _decimals, bytes32 _name, bytes32 _symbol) external;

function __constructor__() external;
}
74 changes: 74 additions & 0 deletions packages/contracts-bedrock/scripts/DeployMockOKB.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,74 @@
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import { Script } from "forge-std/Script.sol";
import { console2 as console } from "forge-std/console2.sol";

// Contracts
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import { ERC20Burnable } from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";

/// @title MockOKB
/// @notice Mock OKB token for testing custom gas token setup
contract MockOKB is ERC20, ERC20Burnable {
constructor() ERC20("Mock OKB", "OKB") {
_mint(msg.sender, 660000 * 10 ** decimals());
}

function decimals() public pure override returns (uint8) {
return 18;
}

/// @notice Burn all tokens of msg.sender
function triggerBridge() external {
_burn(msg.sender, balanceOf(msg.sender));
}
}

/// @title DeployMockOKB
/// @notice Foundry script to deploy MockOKB token for testing
/// @dev This script deploys a mock OKB token with 660,000 initial supply
contract DeployMockOKB is Script {
// Deployed contract
MockOKB okbToken;
address deployerAddress;

function setUp() public {
// Get deployer address from msg.sender (set by forge script --private-key)
deployerAddress = msg.sender;
console.log("Deployer address:", deployerAddress);
}

function run() public {
console.log("\n=== Deploying Mock OKB Token ===\n");

vm.startBroadcast(msg.sender);

// Deploy Mock OKB Token
deployMockOKB();

vm.stopBroadcast();

// Print deployment summary
printDeploymentSummary();
}

/// @notice Deploy mock OKB token with 660,000 supply
function deployMockOKB() internal {
okbToken = new MockOKB();
console.log("MockOKB deployed at:", address(okbToken));
}

/// @notice Print deployment summary with token details
function printDeploymentSummary() internal view {
console.log("\n=== Deployment Summary ===");
console.log("MockOKB Address:", address(okbToken));
console.log("Token name:", okbToken.name());
console.log("Token symbol:", okbToken.symbol());
console.log("Token decimals:", okbToken.decimals());
console.log("Total supply:", okbToken.totalSupply() / 1e18, "OKB");
console.log("Deployer balance:", okbToken.balanceOf(deployerAddress) / 1e18, "OKB");
console.log("\nEnvironment variable to set:");
console.log("export OKB_TOKEN_ADDRESS=", address(okbToken));
}
}
Loading