-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge remote-tracking branch 'template/main' into update-from-template
- Loading branch information
Showing
19 changed files
with
174 additions
and
121 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1 @@ | ||
UpgradeArbOSVersionAtTimestampActionTest:test_1() (gas: 165) | ||
UpgradeArbOSVersionAtTimestampActionTest:test_1() (gas: 165) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1 +1,16 @@ | ||
{} | ||
{ | ||
"$schema": "https://github.com/IBM/audit-ci/raw/main/docs/schema.json", | ||
"low": true, | ||
"allowlist": [ | ||
// ws affected by a DoS when handling a request with many HTTP headers | ||
"GHSA-3h5v-q93c-6h6q", | ||
// follow-redirects' Proxy-Authorization header kept across hosts | ||
"GHSA-cxjh-pqwp-8mfp", | ||
// Undici's Proxy-Authorization header not cleared on cross-origin redirect for dispatch, request, stream, pipeline | ||
"GHSA-m4v8-wqvr-p9f7", | ||
// Undici's fetch with integrity option is too lax when algorithm is specified but hash value is in incorrect | ||
"GHSA-9qxr-qj54-h672", | ||
// Uncontrolled resource consumption in braces | ||
"GHSA-grv7-fg5c-xmjg" | ||
] | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
import { JsonRpcProvider, Provider, Wallet } from 'ethers' | ||
import { ethers as ethersv5 } from 'ethers-v5' | ||
|
||
export type Unwrap<T> = T extends Promise<infer U> ? U : T | ||
|
||
export function getEnv(name: string): string { | ||
const value = process.env[name] || '' | ||
if (value === '') { | ||
throw new Error(`Environment variable ${name} is not defined`) | ||
} | ||
return value | ||
} | ||
|
||
export class DoubleProvider extends JsonRpcProvider { | ||
public readonly v5: ethersv5.providers.JsonRpcProvider | ||
constructor(public readonly url: string) { | ||
super(url) | ||
this.v5 = new ethersv5.providers.JsonRpcProvider(url) | ||
} | ||
} | ||
|
||
export class DoubleWallet extends Wallet { | ||
public readonly provider!: Provider | ||
public readonly v5: ethersv5.Wallet & { | ||
provider: ethersv5.providers.JsonRpcProvider | ||
} | ||
|
||
constructor( | ||
privateKey: string, | ||
public readonly doubleProvider: DoubleProvider | ||
) { | ||
super(privateKey, doubleProvider) | ||
this.v5 = new ethersv5.Wallet( | ||
privateKey, | ||
doubleProvider.v5 | ||
) as ethersv5.Wallet & { provider: ethersv5.providers.JsonRpcProvider } | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,48 +1,10 @@ | ||
#!/bin/bash | ||
|
||
# run fork tests, tests in fork/<chain_name>/ will be run against <CHAIN_NAME>_FORK_URL | ||
# if there is a chain dir without a corresponding env var, the script will fail | ||
# early exit on failure | ||
set -e | ||
|
||
shopt -s globstar | ||
# run hardhat tests if there are any | ||
test $(find test/fork -name '*.test.ts' | wc -l) -eq 0 || yarn hardhat test $(find test/fork -name '*.test.ts') | ||
|
||
chains=$(ls -d ./test/fork/*/ 2>/dev/null) | ||
|
||
if [ -z "$chains" ]; then | ||
echo "No directories found in ./test/fork/" | ||
exit 0 | ||
fi | ||
|
||
for dir in $chains; do | ||
dirName=$(basename "$dir") | ||
forkUrlName="${dirName^^}_FORK_URL" | ||
forkUrl="${!forkUrlName}" | ||
|
||
if [ -z "$forkUrl" ]; then | ||
echo "No value found for $forkUrlName" | ||
exit 1 | ||
fi | ||
|
||
code=0 | ||
|
||
hardhatFiles=$(find "$dir" -name "*.test.ts") | ||
if [ -z "$hardhatFiles" ]; then | ||
echo "No .test.ts files found in $dir" | ||
else | ||
echo "Running hardhat tests against \$$forkUrlName ..." | ||
FORK_URL=$forkUrl yarn run hardhat test $hardhatFiles --network fork | ||
CODE=$? | ||
fi | ||
[ "$code" -ne 0 ] && exit $code | ||
|
||
foundryFiles=$(find "$dir" -name "*.t.sol") | ||
if [ -z "$foundryFiles" ]; then | ||
echo "No .t.sol files found in $dir" | ||
else | ||
echo "Running foundry tests against \$$forkUrlName ..." | ||
forge test --fork-url $forkUrl --match-path "$dir**/*.t.sol" | ||
code=$? | ||
fi | ||
[ "$code" -ne 0 ] && exit $code | ||
done | ||
|
||
exit 0 | ||
# run foundry tests if there are any | ||
test $(find test/fork -name '*.t.sol' | wc -l) -eq 0 || forge test --match-path 'test/fork/**/*.t.sol' |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,8 @@ | ||
// SPDX-License-Identifier: MIT | ||
pragma solidity ^0.8.16; | ||
|
||
contract SampleMock { | ||
function arbOSVersion() external pure returns (uint256) { | ||
return 1; | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,21 +1,10 @@ | ||
#!/bin/bash | ||
|
||
shopt -s globstar | ||
# early exit on failure | ||
set -e | ||
|
||
code=0 | ||
# run hardhat tests if there are any | ||
test $(find test/unit -name '*.test.ts' | wc -l) -eq 0 || yarn hardhat test $(find test/unit -name '*.test.ts') | ||
|
||
hardhatFiles=$(ls ./test/unit/**/*.test.ts 2>/dev/null) | ||
if [ -n "$hardhatFiles" ]; then | ||
yarn run hardhat test $hardhatFiles | ||
code=$? | ||
fi | ||
|
||
[ "$code" -ne 0 ] && exit $code | ||
|
||
foundryFiles=$(ls ./test/unit/**/*.t.sol 2>/dev/null) | ||
if [ -n "$foundryFiles" ]; then | ||
forge test --match-path "test/unit/*.t.sol" | ||
code=$? | ||
fi | ||
|
||
exit $code | ||
# run foundry tests if there are any | ||
test $(find test/unit -name '*.t.sol' | wc -l) -eq 0 || forge test --match-path 'test/unit/**/*.t.sol' |
Empty file.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.