Skip to content

Commit

Permalink
Initial commit
Browse files Browse the repository at this point in the history
  • Loading branch information
oguimbal committed Jul 29, 2022
0 parents commit 77b26fe
Show file tree
Hide file tree
Showing 74 changed files with 2,935 additions and 0 deletions.
3 changes: 3 additions & 0 deletions .env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
ETHERSCAN_API_KEY=ABC123ABC123ABC123ABC123ABC123ABC1
ROPSTEN_URL=https://eth-ropsten.alchemyapi.io/v2/<YOUR ALCHEMY KEY>
PRIVATE_KEY=0xabc123abc123abc123abc123abc123abc123abc123abc123abc123abc123abc1
61 changes: 61 additions & 0 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: ci

on: [push]

jobs:
tests:
name: Tests with Foundry
runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install Huff
uses: huff-language/huff-toolchain@v2
with:
version: nightly

- name: Run Tests
run: forge test -vvv

scripts:
strategy:
fail-fast: true
name: Run Scripts
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
submodules: recursive

- name: Install Foundry
uses: foundry-rs/foundry-toolchain@v1
with:
version: nightly

- name: Install Huff
uses: huff-language/huff-toolchain@v2
with:
version: nightly

- name: Run Forge build
run: |
forge --version
forge build --sizes
id: build
continue-on-error: true

- name: Run scripts
run: |
ls -lsa
ls script/
for file in script/*; do
forge script $file -vvvv
done
22 changes: 22 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# Any Node Modules
node_modules/

# Environment Variables
.env
.env.prod

# Cached Build
cache/
out/

# Vscode
.vscode/

# huffc artifacts
artifacts

# Ignore flattened files
flattened.txt

# Ignore Broadcasts
broadcast
9 changes: 9 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
[submodule "lib/foundry-huff"]
path = lib/foundry-huff
url = https://github.com/huff-language/foundry-huff
[submodule "lib/forge-std"]
path = lib/forge-std
url = https://github.com/foundry-rs/forge-std
[submodule "lib/openzeppelin-contracts"]
path = lib/openzeppelin-contracts
url = https://github.com/OpenZeppelin/openzeppelin-contracts
24 changes: 24 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
This is free and unencumbered software released into the public domain.

Anyone is free to copy, modify, publish, use, compile, sell, or
distribute this software, either in source code form or as a compiled
binary, for any purpose, commercial or non-commercial, and by any
means.

In jurisdictions that recognize copyright laws, the author or authors
of this software dedicate any and all copyright interest in the
software to the public domain. We make this dedication for the benefit
of the public at large and to the detriment of our heirs and
successors. We intend this dedication to be an overt act of
relinquishment in perpetuity of all present and future rights to this
software under copyright law.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND,
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
IN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR
OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,
ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
OTHER DEALINGS IN THE SOFTWARE.

For more information, please refer to <http://unlicense.org/>
Empty file added README.md
Empty file.
Binary file added assets/blueprint.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
12 changes: 12 additions & 0 deletions foundry.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

[profile.default]
solc_version = '0.8.15'
auto_detect_solc = false
optimizer = true
optimizer_runs = 200 # Default amount
ffi = true
fuzz_runs = 1_000
remappings = [
"forge-std=lib/forge-std/src/",
"foundry-huff=lib/foundry-huff/src/",
]
1 change: 1 addition & 0 deletions lib/forge-std
Submodule forge-std added at d908e7
1 change: 1 addition & 0 deletions lib/foundry-huff
Submodule foundry-huff added at 599e7c
1 change: 1 addition & 0 deletions lib/openzeppelin-contracts
Submodule openzeppelin-contracts added at 7b5ef4
8 changes: 8 additions & 0 deletions remappings.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
ds-test/=lib/forge-std/lib/ds-test/src/
forge-std=lib/forge-std/src/
forge-std/=lib/forge-std/src/
foundry-huff=lib/foundry-huff/src/
foundry-huff/=lib/foundry-huff/src/
@openzeppelin/=lib/openzeppelin-contracts/
solidity-stringutils/=lib/foundry-huff/lib/solidity-stringutils/src/
stringutils/=lib/foundry-huff/lib/solidity-stringutils/
16 changes: 16 additions & 0 deletions script/Deploy.s.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
// SPDX-License-Identifier: Unlicense
pragma solidity ^0.8.15;

import "foundry-huff/HuffDeployer.sol";
import "forge-std/Script.sol";

interface SimpleStore {
function setValue(uint256) external;
function getValue() external returns (uint256);
}

contract Deploy is Script {
function run() public returns (SimpleStore simpleStore) {
simpleStore = SimpleStore(HuffDeployer.deploy("SimpleStore"));
}
}
2 changes: 2 additions & 0 deletions solc
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
a
b --bin
15 changes: 15 additions & 0 deletions src/INVMCallVerifier.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

/**
* @dev A call verifier for NVM
*/
interface INVMCallVerifier {
function verifyCall(
uint8 opcode,
address callContract,
uint256 valueSent,
bytes memory callDataSlice,
bool truncated
) external returns (bool);
}
Loading

0 comments on commit 77b26fe

Please sign in to comment.