Skip to content

Commit

Permalink
Merge branch 'dev' into semantic-money
Browse files Browse the repository at this point in the history
  • Loading branch information
0xdavinchee committed May 5, 2023
2 parents 5716f0e + 889f582 commit 60d0c2f
Show file tree
Hide file tree
Showing 11 changed files with 57 additions and 37 deletions.
15 changes: 11 additions & 4 deletions .github/workflows/call.test-hot-fuzz.yml
Expand Up @@ -9,21 +9,28 @@ jobs:

runs-on: ubuntu-latest

defaults:
run:
shell: nix develop .#ci-hot-fuzz -c bash {0}

steps:
- uses: actions/checkout@v3

- uses: cachix/install-nix-action@v19
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Prepare devShell
- name: Initialize devShell
run: |
echo 'nix develop .#ci-hot-fuzz -c bash $@' > devShell.sh
yarn install
set -xe
slither --version
echidna-test --version
- name: Run Yarn Install
run: yarn install

- name: Run tests
run: |
cd packages/hot-fuzz
echo "testLimit: 1000" >> echidna.yaml
./hot-fuzz contracts/superfluid-tests/SuperHotFuzz.yaml
shell: sh devShell.sh {0}
29 changes: 13 additions & 16 deletions .github/workflows/call.test-spec-haskell.yml
Expand Up @@ -5,59 +5,56 @@ on:

jobs:
test-spec-haskell:
name: Test Spec Haskell - Linux - ${{ matrix.compiler }}
name: Test Spec Haskell - Linux - ${{ matrix.compiler-name }}

runs-on: ubuntu-latest

continue-on-error: ${{ matrix.allow-failure }}

strategy:
matrix:
include:
- compiler: ghc-9.2.5
devShell: ci-spec-ghc925
allow-failure: false
- compiler: ghc-9.4.4
devShell: ci-spec-ghc944
allow-failure: false
- compiler-name: ghc-9.2.5
dev-shell-type: ci-spec-ghc925
- compiler-name: ghc-9.4.4
dev-shell-type: ci-spec-ghc944
fail-fast: false

defaults:
run:
shell: nix develop .#${{ matrix.dev-shell-type }} -c bash {0}

steps:
- uses: actions/checkout@v3

- uses: cachix/install-nix-action@v19
with:
github_access_token: ${{ secrets.GITHUB_TOKEN }}

- name: Create devShell
- name: Initialize devShell
run: |
echo 'nix develop .#${{ matrix.devShell }} -c bash $@' > devShell.sh
set -xe
cabal --version
ghc --version
- name: Run cabal update
run: |
cabal v2-update
shell: sh devShell.sh {0}
- name: Run lint
run: |
cd packages/spec-haskell
make lint
shell: sh devShell.sh {0}
- name: Run build
run: |
cd packages/spec-haskell
make build
shell: sh devShell.sh {0}
- name: Run tests
run: |
cd packages/spec-haskell
make test
shell: sh devShell.sh {0}
- name: Make haddock docs
run: |
cd packages/spec-haskell
make docs-haddock
shell: sh devShell.sh {0}
1 change: 1 addition & 0 deletions .github/workflows/ci.canary.yml
Expand Up @@ -60,6 +60,7 @@ jobs:

test-hot-fuzz:
uses: ./.github/workflows/call.test-hot-fuzz.yml
if: false # broken atm

test-subgraph:
uses: ./.github/workflows/call.test-local-subgraph.yml
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/ci.feature.yml
Expand Up @@ -144,7 +144,7 @@ jobs:
test-hot-fuzz:
uses: ./.github/workflows/call.test-hot-fuzz.yml
needs: [ check ]
if: needs.check.outputs.build_hot_fuzz
if: false # TODO broken atm, otherwise needs.check.outputs.build_hot_fuzz

test-solidity-semantic-money:
uses: ./.github/workflows/call.test-solidity-semantic-money.yml
Expand Down
4 changes: 3 additions & 1 deletion packages/ethereum-contracts/.gitignore
Expand Up @@ -8,4 +8,6 @@
/typechain-types
/dev-scripts/**/*.d.ts
/dev-scripts/**/*.d.ts.map
.gas-snapshot
/.gas-snapshot
/lib
/packages
3 changes: 2 additions & 1 deletion packages/ethereum-contracts/foundry.toml
@@ -1,6 +1,7 @@
[profile.default]
root = '../..'
src = 'packages/ethereum-contracts'
src = 'packages/ethereum-contracts/contracts'
test = 'packages/ethereum-contracts/test/foundry/'
solc_version = "0.8.19"
remappings = [
'@superfluid-finance/ethereum-contracts/contracts/=packages/ethereum-contracts/contracts/',
Expand Down
21 changes: 17 additions & 4 deletions packages/hot-fuzz/contracts/HotFuzzBase.sol
Expand Up @@ -11,12 +11,15 @@ import {
SuperToken,
SuperfluidFrameworkDeployer
} from "@superfluid-finance/ethereum-contracts/contracts/utils/SuperfluidFrameworkDeployer.sol";
import {
TestToken,
SuperTokenDeployer
} from "@superfluid-finance/ethereum-contracts/contracts/utils/SuperTokenDeployer.sol";
import "@superfluid-finance/ethereum-contracts/contracts/apps/CFAv1Library.sol";
import "@superfluid-finance/ethereum-contracts/contracts/apps/IDAv1Library.sol";

import {
IERC20,
TestToken,
ISuperToken,
IConstantFlowAgreementV1,
IInstantDistributionAgreementV1,
Expand All @@ -31,12 +34,13 @@ contract HotFuzzBase {

// immutables
SuperfluidFrameworkDeployer private immutable _sfDeployer;
SuperfluidFrameworkDeployer.Framework internal sf;

SuperTokenDeployer private immutable _superTokenDeployer;
TestToken internal immutable token;
SuperToken internal immutable superToken;
uint internal immutable nTesters;

SuperfluidFrameworkDeployer.Framework internal sf;

// test states
SuperfluidTester[] internal testers;
address[] internal otherAccounts;
Expand All @@ -46,7 +50,16 @@ contract HotFuzzBase {
_sfDeployer = new SuperfluidFrameworkDeployer();
sf = _sfDeployer.getFramework();

(token, superToken) = _sfDeployer.deployWrapperSuperToken("HOTFuzz Token", "HOTT", 18, type(uint256).max);
_superTokenDeployer = new SuperTokenDeployer(
address(sf.superTokenFactory),
address(sf.resolver)
);
// add superTokenDeployer as admin to the resolver so it can register the SuperTokens
sf.resolver.addAdmin(address(_superTokenDeployer));

(token, superToken) = _superTokenDeployer.deployWrapperSuperToken(
"HOTFuzz Token", "HOTT", 18, type(uint256).max
);
nTesters = nTesters_;
otherAccounts = new address[](0);
}
Expand Down
5 changes: 2 additions & 3 deletions packages/hot-fuzz/hot-fuzz
Expand Up @@ -41,9 +41,8 @@ function hott() {
rm -rf crytic-export/
rm -rf build/hot-fuzz-contracts/
npx truffle compile --all \
&& "$ECHIDNA_TEST" . --config <(cat $HOTFUZZ_DIR/echidna.yaml $TEST_CONTRACT_CONFIG) --contract $TEST_CONTRACT

digests
&& "$ECHIDNA_TEST" . --config <(cat $HOTFUZZ_DIR/echidna.yaml $TEST_CONTRACT_CONFIG) --contract $TEST_CONTRACT \
&& digests
}

TEST_CONTRACT_CONFIG=$1
Expand Down
10 changes: 5 additions & 5 deletions packages/hot-fuzz/index.js
Expand Up @@ -15,12 +15,12 @@ function hotfuzzPatchTruffleConfig(c) {
SlotsBitmapLibrary: "0x" + "0".repeat(38) + "f1",
},
"@superfluid-finance/ethereum-contracts/contracts/utils/SuperfluidFrameworkDeployer.sol": {
SuperfluidCFAv1DeployerLibrary: "0x" + "0".repeat(38) + "f2",
SuperfluidGovDeployerLibrary: "0x" + "0".repeat(38) + "f3",
SuperfluidHostDeployerLibrary: "0x" + "0".repeat(38) + "f4",
SuperfluidIDAv1DeployerLibrary: "0x" + "0".repeat(38) + "f5",
SuperfluidCFAv1DeployerLibrary: "0x" + "0".repeat(38) + "f2",
SuperfluidGovDeployerLibrary: "0x" + "0".repeat(38) + "f3",
SuperfluidHostDeployerLibrary: "0x" + "0".repeat(38) + "f4",
SuperfluidIDAv1DeployerLibrary: "0x" + "0".repeat(38) + "f5",
SuperfluidPeripheryDeployerLibrary: "0x" + "0".repeat(38) + "f6",
SuperTokenDeployerLibrary: "0x" + "0".repeat(38) + "f7",
SuperTokenDeployerLibrary: "0x" + "0".repeat(38) + "f7",
},
};

Expand Down
2 changes: 1 addition & 1 deletion packages/hot-fuzz/package.json
Expand Up @@ -18,7 +18,7 @@
"directory": "packages/hot-fuzz"
},
"dependencies": {
"@openzeppelin/contracts": "4.8.0"
"@openzeppelin/contracts": "4.8.2"
},
"peerDependencies": {
"@superfluid-finance/ethereum-contracts": "1.2.2"
Expand Down
2 changes: 1 addition & 1 deletion packages/hot-fuzz/truffle-config.js
Expand Up @@ -81,7 +81,7 @@ const M = (module.exports = {
// Configure your compilers
compilers: {
solc: {
version: "0.8.18", // Fetch exact version from solc-bin (default: truffle's version)
version: "0.8.19", // Fetch exact version from solc-bin (default: truffle's version)
// docker: true, // Use "0.5.1" you've installed locally with docker (default: false)
settings: {
// See the solidity docs for advice about optimization and evmVersion
Expand Down

0 comments on commit 60d0c2f

Please sign in to comment.