Skip to content

Commit

Permalink
Merge pull request #21 from lidofinance/feature/improve_scripts
Browse files Browse the repository at this point in the history
Feature/improve scripts
  • Loading branch information
kovalgek authored Jul 7, 2024
2 parents 1654e92 + 7f834a5 commit 3aad26c
Show file tree
Hide file tree
Showing 11 changed files with 11,791 additions and 15,163 deletions.
21 changes: 18 additions & 3 deletions .env.example
Original file line number Diff line number Diff line change
Expand Up @@ -37,15 +37,30 @@ ACCOUNTING_ORACLE=
# l2GasLimit = (gas cost of L2Bridge.finalizeDeposit() + OptimismPortal.minimumGasLimit(depositData.length)) * 1.5
L2_GAS_LIMIT_FOR_PUSHING_TOKEN_RATE=

# Address of L1 token bridge proxy. Should be provided only for upgrade.
# Address of L1 token bridge proxy.
L1_TOKEN_BRIDGE=

# Address of Lido Core protocol contract
LIDO=

# Account that is allowed to add or remove pushers.
TOKEN_RATE_NOTIFIER_OWNER=

############ L2 Part
###### TokenRateOracle params

# Address of the account to grant the DEFAULT_ADMIN_ROLE
TOKEN_RATE_ORACLE_ADMIN=

# Enable token rate orace updates
TOKEN_RATE_UPDATE_ENABLED=

# Roles granting the permission to pause updating rate.
TOKEN_RATE_UPDATE_DISABLERS=

# Roles granting the permission to resume updating rate.
TOKEN_RATE_UPDATE_ENABLERS=

# A time period when token rate can be considered outdated. Default is 86400 (24 hours)
TOKEN_RATE_OUTDATED_DELAY=

Expand All @@ -64,10 +79,10 @@ OLDEST_RATE_ALLOWED_IN_PAUSE_TIME_SPAN=
MIN_TIME_BETWEEN_TOKEN_RATE_UPDATES=

# Initial wstETH/stETH token rate, uses 10**27 precision.
TOKEN_RATE=
INITIAL_TOKEN_RATE_VALUE=

# Initial L1 time when rate was updated on L1 side.
TOKEN_RATE_L1_TIMESTAMP=
INITIAL_TOKEN_RATE_L1_TIMESTAMP=

###### L2 wstETH Token.
# Address of the L2 non-rebasable token (L2 wstETH) proxy on L2. Should be provided only for upgrade.
Expand Down
21 changes: 0 additions & 21 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -167,27 +167,6 @@ TESTING_OPT_L1_ERC20_TOKEN_BRIDGE=
TESTING_OPT_L2_ERC20_TOKEN_BRIDGE=
```

### Acceptance tests

The acceptance tests might be run after the deployment to validate that the bridge was deployed with the correct parameters.

The following ENV variables must be set before the tests running:

```bash
# Addresses of the Optimism bridge
TESTING_OPT_L1_TOKEN=
TESTING_OPT_L2_TOKEN=
TESTING_OPT_L1_ERC20_TOKEN_BRIDGE=
TESTING_OPT_L2_ERC20_TOKEN_BRIDGE=
```

To run the acceptance tests, use the following commands:

```bash
# Optimism bridge
npm run optimism:test:acceptance
```

## Code Coverage

To run coverage measurement for unit tests:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,14 +9,8 @@ import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
/// @dev For testing purposes.
contract OpStackTokenRatePusherWithOutOfGasErrorStub is ERC165, ITokenRatePusher {

uint256 public constant OUT_OF_GAS_INCURRING_MAX = 1000000000000;

mapping (uint256 => uint256) public data;

function pushTokenRate() external {
for (uint256 i = 0; i < OUT_OF_GAS_INCURRING_MAX; ++i) {
data[i] = i;
}
revert();
}

/// @inheritdoc ERC165
Expand Down
Loading

0 comments on commit 3aad26c

Please sign in to comment.