@arbitrum/nitro-contracts 1.0.0-beta.1 → 1.0.0-beta.4
Sign up to get free protection for your applications and to get access to all the features.
- package/README.md +15 -0
- package/package.json +12 -8
- package/src/bridge/IInbox.sol +9 -0
- package/src/bridge/Inbox.sol +19 -39
- package/src/libraries/AdminFallbackProxy.sol +5 -5
- package/src/libraries/MessageTypes.sol +1 -0
- package/src/mocks/InboxStub.sol +4 -0
- package/src/mocks/Simple.sol +30 -0
- package/src/node-interface/NodeInterface.sol +18 -1
- package/src/node-interface/NodeInterfaceDebug.sol +30 -0
- package/src/osp/OneStepProver0.sol +14 -0
- package/src/osp/OneStepProverMath.sol +2 -2
- package/src/precompiles/ArbOwner.sol +3 -0
- package/src/rollup/IRollupCore.sol +26 -2
- package/src/rollup/IRollupEventBridge.sol +17 -0
- package/src/rollup/IRollupLogic.sol +34 -2
- package/src/rollup/RollupCore.sol +2 -2
- package/src/rollup/RollupCreator.sol +5 -15
- package/src/rollup/RollupEventBridge.sol +2 -3
- package/src/rollup/RollupLib.sol +2 -2
- package/src/rollup/RollupUserLogic.sol +7 -3
- package/src/rollup/ValidatorUtils.sol +0 -1
- package/src/rollup/ValidatorWallet.sol +0 -1
- package/src/state/Instructions.sol +2 -0
- package/.prettierrc +0 -5
- package/.solhint.json +0 -18
- package/deploy/BridgeStubCreator.js +0 -10
- package/deploy/HashProofHelper.js +0 -13
- package/deploy/InboxStubCreator.js +0 -17
- package/deploy/OneStepProofEntryCreator.js +0 -19
- package/deploy/OneStepProver0Creator.js +0 -14
- package/deploy/OneStepProverHostIoCreator.js +0 -14
- package/deploy/OneStepProverMathCreator.js +0 -14
- package/deploy/OneStepProverMemoryCreator.js +0 -14
- package/deploy/SequencerInboxStubCreator.js +0 -13
- package/deploy/ValueArrayTesterCreator.js +0 -13
- package/hardhat.config.ts +0 -47
- package/src/mocks/Counter.sol +0 -13
- package/test/contract/arbRollup.spec.ts +0 -869
- package/test/contract/common/challengeLib.ts +0 -43
- package/test/contract/common/globalStateLib.ts +0 -17
- package/test/contract/common/rolluplib.ts +0 -259
- package/test/contract/cryptographyPrimitives.spec.ts +0 -82
- package/test/contract/sequencerInboxForceInclude.spec.ts +0 -516
- package/test/contract/utils.ts +0 -40
- package/test/prover/hash-proofs.ts +0 -75
- package/test/prover/one-step-proof.ts +0 -93
- package/test/prover/proofs/.gitkeep +0 -0
- package/test/prover/value-arrays.ts +0 -11
- package/tsconfig.json +0 -13
@@ -150,6 +150,8 @@ library Instructions {
|
|
150
150
|
uint16 internal constant READ_INBOX_MESSAGE = 0x8021;
|
151
151
|
uint16 internal constant HALT_AND_SET_FINISHED = 0x8022;
|
152
152
|
|
153
|
+
uint16 internal constant ARBITRARY_JUMP = 0x8023;
|
154
|
+
|
153
155
|
uint256 internal constant INBOX_INDEX_SEQUENCER = 0;
|
154
156
|
uint256 internal constant INBOX_INDEX_DELAYED = 1;
|
155
157
|
|
package/.prettierrc
DELETED
package/.solhint.json
DELETED
@@ -1,18 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"extends": ["solhint:recommended"],
|
3
|
-
"rules": {
|
4
|
-
"prettier/prettier": "error",
|
5
|
-
"avoid-throw": "off",
|
6
|
-
"avoid-suicide": "error",
|
7
|
-
"avoid-sha3": "warn",
|
8
|
-
"max-line-length": "off",
|
9
|
-
"compiler-version": "off",
|
10
|
-
"func-visibility": ["warn",{"ignoreConstructors":true}],
|
11
|
-
"no-empty-blocks": "off",
|
12
|
-
"reason-string": ["warn",{"maxLength":128}],
|
13
|
-
"not-rely-on-time": "off",
|
14
|
-
"max-states-count": ["warn",30],
|
15
|
-
"no-inline-assembly": "off"
|
16
|
-
},
|
17
|
-
"plugins": ["prettier"]
|
18
|
-
}
|
@@ -1,10 +0,0 @@
|
|
1
|
-
module.exports = async (hre) => {
|
2
|
-
const { deployments, getNamedAccounts, ethers } = hre;
|
3
|
-
const { deploy } = deployments;
|
4
|
-
const { deployer } = await getNamedAccounts();
|
5
|
-
|
6
|
-
await deploy("BridgeStub", {from: deployer, args: []});
|
7
|
-
};
|
8
|
-
|
9
|
-
module.exports.tags = ["BridgeStub", "test"];
|
10
|
-
module.exports.dependencies = [];
|
@@ -1,13 +0,0 @@
|
|
1
|
-
module.exports = async (hre) => {
|
2
|
-
const { deployments, getNamedAccounts } = hre;
|
3
|
-
const { deploy } = deployments;
|
4
|
-
const { deployer } = await getNamedAccounts();
|
5
|
-
|
6
|
-
await deploy("HashProofHelper", {
|
7
|
-
from: deployer,
|
8
|
-
args: [],
|
9
|
-
});
|
10
|
-
};
|
11
|
-
|
12
|
-
module.exports.tags = ["HashProofHelper", "test", "live"];
|
13
|
-
module.exports.dependencies = [];
|
@@ -1,17 +0,0 @@
|
|
1
|
-
module.exports = async (hre) => {
|
2
|
-
const { deployments, getNamedAccounts, ethers } = hre;
|
3
|
-
const { deploy } = deployments;
|
4
|
-
const { deployer } = await getNamedAccounts();
|
5
|
-
|
6
|
-
await deploy("InboxStub", {from: deployer, args: []});
|
7
|
-
|
8
|
-
const bridge = await ethers.getContract("BridgeStub");
|
9
|
-
const inbox = await ethers.getContract("InboxStub");
|
10
|
-
|
11
|
-
await bridge.setInbox(inbox.address, true);
|
12
|
-
await inbox.initialize(bridge.address);
|
13
|
-
};
|
14
|
-
|
15
|
-
module.exports.tags = ["InboxStub", "test"];
|
16
|
-
module.exports.dependencies = ["BridgeStub"];
|
17
|
-
|
@@ -1,19 +0,0 @@
|
|
1
|
-
module.exports = async (hre) => {
|
2
|
-
const { deployments, getNamedAccounts } = hre;
|
3
|
-
const { deploy } = deployments;
|
4
|
-
const { deployer } = await getNamedAccounts();
|
5
|
-
|
6
|
-
await deploy("OneStepProofEntry", {
|
7
|
-
from: deployer,
|
8
|
-
args: [
|
9
|
-
(await deployments.get("OneStepProver0")).address,
|
10
|
-
(await deployments.get("OneStepProverMemory")).address,
|
11
|
-
(await deployments.get("OneStepProverMath")).address,
|
12
|
-
(await deployments.get("OneStepProverHostIo")).address,
|
13
|
-
],
|
14
|
-
});
|
15
|
-
};
|
16
|
-
|
17
|
-
module.exports.tags = ["OneStepProofEntry"];
|
18
|
-
module.exports.dependencies = ["OneStepProver0", "OneStepProverMemory", "OneStepProverMath", "OneStepProverHostIo"];
|
19
|
-
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module.exports = async (hre) => {
|
2
|
-
const { deployments, getNamedAccounts } = hre;
|
3
|
-
const { deploy } = deployments;
|
4
|
-
const { deployer } = await getNamedAccounts();
|
5
|
-
|
6
|
-
await deploy("OneStepProver0", {
|
7
|
-
from: deployer,
|
8
|
-
args: [],
|
9
|
-
});
|
10
|
-
};
|
11
|
-
|
12
|
-
module.exports.tags = ["OneStepProver0", "live", "test"];
|
13
|
-
module.exports.dependencies = [];
|
14
|
-
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module.exports = async (hre) => {
|
2
|
-
const { deployments, getNamedAccounts, ethers } = hre;
|
3
|
-
const { deploy } = deployments;
|
4
|
-
const { deployer } = await getNamedAccounts();
|
5
|
-
|
6
|
-
await deploy("OneStepProverHostIo", {
|
7
|
-
from: deployer,
|
8
|
-
args: [],
|
9
|
-
});
|
10
|
-
};
|
11
|
-
|
12
|
-
module.exports.tags = ["OneStepProverHostIo"];
|
13
|
-
module.exports.dependencies = [];
|
14
|
-
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module.exports = async (hre) => {
|
2
|
-
const { deployments, getNamedAccounts } = hre;
|
3
|
-
const { deploy } = deployments;
|
4
|
-
const { deployer } = await getNamedAccounts();
|
5
|
-
|
6
|
-
await deploy("OneStepProverMath", {
|
7
|
-
from: deployer,
|
8
|
-
args: [],
|
9
|
-
});
|
10
|
-
};
|
11
|
-
|
12
|
-
module.exports.tags = ["OneStepProverMath", "live", "test"];
|
13
|
-
module.exports.dependencies = [];
|
14
|
-
|
@@ -1,14 +0,0 @@
|
|
1
|
-
module.exports = async (hre) => {
|
2
|
-
const { deployments, getNamedAccounts } = hre;
|
3
|
-
const { deploy } = deployments;
|
4
|
-
const { deployer } = await getNamedAccounts();
|
5
|
-
|
6
|
-
await deploy("OneStepProverMemory", {
|
7
|
-
from: deployer,
|
8
|
-
args: [],
|
9
|
-
});
|
10
|
-
};
|
11
|
-
|
12
|
-
module.exports.tags = ["OneStepProverMemory", "live", "test"];
|
13
|
-
module.exports.dependencies = [];
|
14
|
-
|
@@ -1,13 +0,0 @@
|
|
1
|
-
module.exports = async (hre) => {
|
2
|
-
const { deployments, getNamedAccounts, ethers } = hre;
|
3
|
-
const { deploy } = deployments;
|
4
|
-
const { deployer } = await getNamedAccounts();
|
5
|
-
|
6
|
-
const bridge = await ethers.getContract("BridgeStub");
|
7
|
-
const maxTime = {delayBlocks: 10000, futureBlocks: 10000, delaySeconds: 10000, futureSeconds: 10000}
|
8
|
-
await deploy("SequencerInboxStub", {from: deployer, args: [bridge.address, deployer, maxTime]})
|
9
|
-
};
|
10
|
-
|
11
|
-
module.exports.tags = ["SequencerInboxStub", "test"];
|
12
|
-
module.exports.dependencies = ["BridgeStub"];
|
13
|
-
|
@@ -1,13 +0,0 @@
|
|
1
|
-
module.exports = async (hre) => {
|
2
|
-
const { deployments, getNamedAccounts } = hre;
|
3
|
-
const { deploy } = deployments;
|
4
|
-
const { deployer } = await getNamedAccounts();
|
5
|
-
|
6
|
-
await deploy("ValueArrayTester", {
|
7
|
-
from: deployer,
|
8
|
-
args: [],
|
9
|
-
});
|
10
|
-
};
|
11
|
-
|
12
|
-
module.exports.tags = ["ValueArrayTester", "test"];
|
13
|
-
module.exports.dependencies = [];
|
package/hardhat.config.ts
DELETED
@@ -1,47 +0,0 @@
|
|
1
|
-
import '@nomiclabs/hardhat-waffle'
|
2
|
-
import 'hardhat-deploy'
|
3
|
-
import '@nomiclabs/hardhat-ethers'
|
4
|
-
import '@typechain/hardhat'
|
5
|
-
import 'solidity-coverage'
|
6
|
-
import prodConfig from "./hardhat.prod-config"
|
7
|
-
|
8
|
-
/**
|
9
|
-
* @type import('hardhat/config').HardhatUserConfig
|
10
|
-
*/
|
11
|
-
module.exports = {
|
12
|
-
...prodConfig,
|
13
|
-
namedAccounts: {
|
14
|
-
deployer: {
|
15
|
-
default: 0,
|
16
|
-
},
|
17
|
-
},
|
18
|
-
networks: {
|
19
|
-
hardhat: {
|
20
|
-
chainId: 1338,
|
21
|
-
throwOnTransactionFailures: true,
|
22
|
-
allowUnlimitedContractSize: true,
|
23
|
-
accounts: {
|
24
|
-
accountsBalance: '1000000000000000000000000000',
|
25
|
-
},
|
26
|
-
blockGasLimit: 200000000,
|
27
|
-
// mining: {
|
28
|
-
// auto: false,
|
29
|
-
// interval: 1000,
|
30
|
-
// },
|
31
|
-
forking: {
|
32
|
-
url: 'https://mainnet.infura.io/v3/' + process.env['INFURA_KEY'],
|
33
|
-
enabled: process.env['SHOULD_FORK'] === '1',
|
34
|
-
},
|
35
|
-
},
|
36
|
-
geth: {
|
37
|
-
url: 'http://localhost:8545',
|
38
|
-
},
|
39
|
-
},
|
40
|
-
mocha: {
|
41
|
-
timeout: 0,
|
42
|
-
},
|
43
|
-
typechain: {
|
44
|
-
outDir: 'build/types',
|
45
|
-
target: 'ethers-v5',
|
46
|
-
},
|
47
|
-
}
|
package/src/mocks/Counter.sol
DELETED
@@ -1,13 +0,0 @@
|
|
1
|
-
// Copyright 2021-2022, Offchain Labs, Inc.
|
2
|
-
// For license information, see https://github.com/nitro/blob/master/LICENSE
|
3
|
-
// SPDX-License-Identifier: BUSL-1.1
|
4
|
-
|
5
|
-
pragma solidity ^0.8.0;
|
6
|
-
|
7
|
-
contract Simple {
|
8
|
-
uint64 public counter;
|
9
|
-
|
10
|
-
function increment() external {
|
11
|
-
counter++;
|
12
|
-
}
|
13
|
-
}
|