Skip to content

Commit

Permalink
update scroll scripts
Browse files Browse the repository at this point in the history
  • Loading branch information
zkbenny committed May 27, 2024
1 parent 00534d2 commit 64d300c
Show file tree
Hide file tree
Showing 13 changed files with 1,324 additions and 253 deletions.
2 changes: 1 addition & 1 deletion contracts/dev-contracts/DummyArbitrator.sol
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ contract DummyArbitrator is IArbitrator, OwnableUpgradeable, UUPSUpgradeable, Re
bytes calldata _adapterParams
) external payable {
// Forward fee to send message
_gateway.sendMessage{value: msg.value + _value}(_value, _callData, _adapterParams);
_gateway.sendMessage{value: msg.value}(_value, _callData, _adapterParams);
}

function claimMessage(
Expand Down
5 changes: 2 additions & 3 deletions contracts/dev-contracts/DummyZkLink.sol
Original file line number Diff line number Diff line change
Expand Up @@ -41,8 +41,7 @@ contract DummyZkLink is IZkLink, OwnableUpgradeable, UUPSUpgradeable, Reentrancy
return gateway;
}

function setGateway(IL2Gateway _gateway) external {
require(address(gateway) == address(0), "Duplicate init gateway");
function setGateway(IL2Gateway _gateway) external onlyOwner {
gateway = _gateway;
}

Expand All @@ -64,7 +63,7 @@ contract DummyZkLink is IZkLink, OwnableUpgradeable, UUPSUpgradeable, Reentrancy
uint256 _toBatchNumber,
bytes32 _rangeBatchRootHash,
uint256 _forwardEthAmount
) external payable {
) external payable onlyGateway {
emit ReceiveRangeBatchRoot(_fromBatchNumber, _toBatchNumber, _rangeBatchRootHash, _forwardEthAmount);
}

Expand Down
5 changes: 5 additions & 0 deletions examples/scroll/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,14 @@ require('./scripts/syncL2Requests');
require('./scripts/syncBatchRoot');
require('./scripts/setValidator');
require('./scripts/changeFeeParams');
require('./scripts/checkTxStatus');

const BaseConfig = require('../../hardhat.base.config');

BigInt.prototype.toJSON = function () {
return this.toString();
};

module.exports = Object.assign({}, BaseConfig, {
paths: {
cache: '../../cache',
Expand Down
156 changes: 130 additions & 26 deletions examples/scroll/package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 2 additions & 0 deletions examples/scroll/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,9 @@
"version": "1.0.0",
"scripts": {},
"devDependencies": {
"@eth-optimism/core-utils": "^0.13.2",
"@nomicfoundation/hardhat-toolbox": "^4.0.0",
"axios": "^1.7.2",
"ethers": "^6.11.1",
"hardhat": "^2.19.5"
},
Expand Down
Loading

0 comments on commit 64d300c

Please sign in to comment.