diff --git a/.envrc b/.envrc new file mode 100644 index 0000000..3550a30 --- /dev/null +++ b/.envrc @@ -0,0 +1 @@ +use flake diff --git a/.gitignore b/.gitignore index 913806e..3844149 100644 --- a/.gitignore +++ b/.gitignore @@ -162,3 +162,10 @@ TSWLatexianTemp* .DS_Store .stack-work/ dist-newstyle/ + +# direnv +.direnv/ + +# nix +result +result/ diff --git a/act/Act/TH/Extractor.hs b/act/Act/TH/Extractor.hs index 5f41e2f..dd8b4f9 100644 --- a/act/Act/TH/Extractor.hs +++ b/act/Act/TH/Extractor.hs @@ -6,13 +6,10 @@ module Act.TH.Extractor (argumentExtractorName, generateExtractMethods) where import Act.Prelude import Act.Utils -import Data.Data import Data.List import Language.Haskell.TH.Syntax as TH import Syntax.Annotated -deriving instance Data AbiType - -- Given each method in the contract we need to know how to extract the arguments from the -- arguments' array. for this we create a partial top-level function which matches -- on the argument array and return the correct number of argument in its expected type diff --git a/act/EVM/TH.hs b/act/EVM/TH.hs index fff6d09..9dd987c 100644 --- a/act/EVM/TH.hs +++ b/act/EVM/TH.hs @@ -122,8 +122,7 @@ emptyVM contracts = { contracts = Map.fromList (fmap (fmap bytecodeToContract) contracts), chainId = 0, storage = EmptyStore, - origStorage = mempty, - sha3Crack = mempty + origStorage = mempty } bytecodeToContract :: ByteString -> Contract diff --git a/flake.lock b/flake.lock new file mode 100644 index 0000000..1ab9d04 --- /dev/null +++ b/flake.lock @@ -0,0 +1,149 @@ +{ + "nodes": { + "act": { + "inputs": { + "flake-utils": "flake-utils", + "nixpkgs": "nixpkgs" + }, + "locked": { + "lastModified": 1685616523, + "narHash": "sha256-fERVRwJxxvOSR+JfvcCXOa5GHrGtYkYHB/Ul2d7gLE8=", + "owner": "ethereum", + "repo": "act", + "rev": "52e99daf3121a4e6a6cb28255e862cf8e83cf4cd", + "type": "github" + }, + "original": { + "owner": "ethereum", + "repo": "act", + "rev": "52e99daf3121a4e6a6cb28255e862cf8e83cf4cd", + "type": "github" + } + }, + "flake-parts": { + "inputs": { + "nixpkgs-lib": "nixpkgs-lib" + }, + "locked": { + "lastModified": 1693611461, + "narHash": "sha256-aPODl8vAgGQ0ZYFIRisxYG5MOGSkIczvu2Cd8Gb9+1Y=", + "owner": "hercules-ci", + "repo": "flake-parts", + "rev": "7f53fdb7bdc5bb237da7fefef12d099e4fd611ca", + "type": "github" + }, + "original": { + "owner": "hercules-ci", + "repo": "flake-parts", + "type": "github" + } + }, + "flake-utils": { + "inputs": { + "systems": "systems" + }, + "locked": { + "lastModified": 1681202837, + "narHash": "sha256-H+Rh19JDwRtpVPAWp64F+rlEtxUWBAQW28eAi3SRSzg=", + "owner": "numtide", + "repo": "flake-utils", + "rev": "cfacdce06f30d2b68473a46042957675eebb3401", + "type": "github" + }, + "original": { + "owner": "numtide", + "repo": "flake-utils", + "type": "github" + } + }, + "haskell-flake": { + "locked": { + "lastModified": 1694478711, + "narHash": "sha256-zW/saV4diypxwP56b8l93Nw8fR7tXLbOFku2I+xYCxU=", + "owner": "srid", + "repo": "haskell-flake", + "rev": "ddc704f3f62d3d3569ced794b534e8fd065c379c", + "type": "github" + }, + "original": { + "owner": "srid", + "repo": "haskell-flake", + "type": "github" + } + }, + "nixpkgs": { + "locked": { + "lastModified": 1684164265, + "narHash": "sha256-ZqNSKSQM12040taiRvSgqwUCPlN1qZAw6nYniYuY1hs=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "872c89e5a754a04058b4531e54897db5ca734100", + "type": "github" + }, + "original": { + "owner": "nixos", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs-lib": { + "locked": { + "dir": "lib", + "lastModified": 1693471703, + "narHash": "sha256-0l03ZBL8P1P6z8MaSDS/MvuU8E75rVxe5eE1N6gxeTo=", + "owner": "NixOS", + "repo": "nixpkgs", + "rev": "3e52e76b70d5508f3cec70b882a29199f4d1ee85", + "type": "github" + }, + "original": { + "dir": "lib", + "owner": "NixOS", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "nixpkgs_2": { + "locked": { + "lastModified": 1695360818, + "narHash": "sha256-JlkN3R/SSoMTa+CasbxS1gq+GpGxXQlNZRUh9+LIy/0=", + "owner": "nixos", + "repo": "nixpkgs", + "rev": "e35dcc04a3853da485a396bdd332217d0ac9054f", + "type": "github" + }, + "original": { + "owner": "nixos", + "ref": "nixos-unstable", + "repo": "nixpkgs", + "type": "github" + } + }, + "root": { + "inputs": { + "act": "act", + "flake-parts": "flake-parts", + "haskell-flake": "haskell-flake", + "nixpkgs": "nixpkgs_2" + } + }, + "systems": { + "locked": { + "lastModified": 1681028828, + "narHash": "sha256-Vy1rq5AaRuLzOxct8nz4T6wlgyUR7zLU309k9mBC768=", + "owner": "nix-systems", + "repo": "default", + "rev": "da67096a3b9bf56a91d16901293e51ba5b49a27e", + "type": "github" + }, + "original": { + "owner": "nix-systems", + "repo": "default", + "type": "github" + } + } + }, + "root": "root", + "version": 7 +} diff --git a/flake.nix b/flake.nix new file mode 100644 index 0000000..389ebd7 --- /dev/null +++ b/flake.nix @@ -0,0 +1,48 @@ +{ + inputs = { + nixpkgs.url = "github:nixos/nixpkgs/nixos-unstable"; + flake-parts.url = "github:hercules-ci/flake-parts"; + haskell-flake.url = "github:srid/haskell-flake"; + act.url = "github:ethereum/act/52e99daf3121a4e6a6cb28255e862cf8e83cf4cd"; + act.flake = false; + }; + + outputs = inputs: + inputs.flake-parts.lib.mkFlake { inherit inputs; } { + systems = [ "x86_64-linux" "x86_64-darwin" "aarch64-darwin" ]; + imports = [ + inputs.haskell-flake.flakeModule + ]; + perSystem = { self', system, lib, config, pkgs, ... }: { + haskellProjects.default = { + basePackages = pkgs.haskell.packages.ghc927; + + packages = { + act.source = "${inputs.act}/src"; + }; + + settings = { + act.extraTestToolDepends = [pkgs.z3]; + poly = { + # TODO: what's going on here? why are these tests failing? where is this dep even coming from? + check = false; + broken = false; + }; + }; + + # send everything but the devShell to the main flake outputs + autoWire = [ "packages" "apps" "checks" ]; + }; + + packages.default = self'.packages.open-games-hs; + apps.default = self'.apps.open-games-hs; + + devShells.default = pkgs.mkShell { + name = "og devshell"; + inputsFrom = [ + config.haskellProjects.default.outputs.devShell + ]; + }; + }; + }; +} diff --git a/open-games-hs.cabal b/open-games-hs.cabal index 21e2f8d..41ac12a 100644 --- a/open-games-hs.cabal +++ b/open-games-hs.cabal @@ -16,6 +16,7 @@ license-file: LICENSE build-type: Simple extra-source-files: README.md + amm.act library exposed-modules: