-
Notifications
You must be signed in to change notification settings - Fork 54
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Parity trie solidity implementation (2/3) (#162)
* init node header * change directory structure to fix compilation issues * node header * init nodecodec * nodecodec progress * nodecodec progress * nodebuilder and fixes Signed-off-by: nadeemb53 <nadeemb53@gmail.com> * nodebuilder completion, bytes to uint8 array * foundry x hardhat directory structure * updated gitignore * fix: lib visibility * forge install: forge-std * added forge-std as submodule * scale codec scope * scale codec little endian to int, compact to int decoding * pr review fixes * remove decodeHash implementation Signed-off-by: nadeemb53 <nadeemb53@gmail.com>
- Loading branch information
Showing
29 changed files
with
23,983 additions
and
15,288 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
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,3 @@ | ||
[submodule "contracts/ethereum/lib/forge-std"] | ||
path = contracts/ethereum/lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std |
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,3 @@ | ||
[submodule "lib/forge-std"] | ||
path = lib/forge-std | ||
url = https://github.com/foundry-rs/forge-std |
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,6 +1,21 @@ | ||
## EVM-IBC | ||
# <h1 align="center"> EVM IBC </h1> | ||
|
||
```shell | ||
### Getting Started | ||
|
||
- Use Foundry: | ||
|
||
```bash | ||
forge install | ||
forge test | ||
``` | ||
|
||
- Use Hardhat: | ||
|
||
```bash | ||
npm install | ||
npx hardhat test | ||
REPORT_GAS=true npx hardhat test | ||
``` | ||
|
||
### Notes | ||
|
||
Whenever you install new libraries using Foundry, make sure to update your `remappings.txt` file by running `forge remappings > remappings.txt`. This is required because we use `hardhat-preprocessor` and the `remappings.txt` file to allow Hardhat to resolve libraries you install with Foundry. |
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
This file was deleted.
Oops, something went wrong.
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,6 @@ | ||
[profile.default] | ||
src = 'src' | ||
out = 'out' | ||
libs = ['lib'] | ||
|
||
# See more config options https://github.com/foundry-rs/foundry/tree/master/config |
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,16 +1,50 @@ | ||
import { HardhatUserConfig } from "hardhat/config"; | ||
import "@nomicfoundation/hardhat-toolbox"; | ||
import fs from "fs"; | ||
import "@nomiclabs/hardhat-waffle"; | ||
import "@typechain/hardhat"; | ||
import "hardhat-preprocessor"; | ||
import { HardhatUserConfig, task } from "hardhat/config"; | ||
|
||
import example from "./tasks/example"; | ||
|
||
function getRemappings() { | ||
return fs | ||
.readFileSync("remappings.txt", "utf8") | ||
.split("\n") | ||
.filter(Boolean) | ||
.map((line) => line.trim().split("=")); | ||
} | ||
|
||
task("example", "Example task").setAction(example); | ||
|
||
const config: HardhatUserConfig = { | ||
solidity: { | ||
version: "0.8.17", | ||
settings: { | ||
optimizer: { | ||
enabled: true, | ||
runs: 1000, | ||
runs: 200, | ||
}, | ||
}, | ||
}, | ||
paths: { | ||
sources: "./src", // Use ./src rather than ./contracts as Hardhat expects | ||
cache: "./cache_hardhat", // Use a different cache for Hardhat than Foundry | ||
}, | ||
// This fully resolves paths for imports in the ./lib directory for Hardhat | ||
preprocess: { | ||
eachLine: (hre) => ({ | ||
transform: (line: string) => { | ||
if (line.match(/^\s*import /i)) { | ||
getRemappings().forEach(([find, replace]) => { | ||
if (line.match(find)) { | ||
line = line.replace(find, replace); | ||
} | ||
}); | ||
} | ||
return line; | ||
}, | ||
}), | ||
}, | ||
}; | ||
|
||
export default config; |
Oops, something went wrong.