Skip to content

Releases: EVMcrispr/evmcrispr

v0.10.4

15 Mar 01:00
Compare
Choose a tag to compare

Patch Changes

v0.10.3

07 Mar 12:02
abb2783
Compare
Choose a tag to compare

Patch Changes

  • 7153e0e: Fix exec and act commands to allow the use of tuples in the function signatures.
  • 49867e9: This patch includes a fix to the aragon:install command, which had a bug that prevented installing many instances of the same app.

v0.10.0

03 Jan 11:47
a4aa60b
Compare
Choose a tag to compare

Improvements

  • Brand new UI style
  • Scripts can be saved to a new Library
  • Scripts can also be shared as IPFS links
  • New @token.amount helper
  • New giveth module
    • New donate command
    • New initiate-givbacks command
    • New finalize-givbacks command
    • New @projectAddr helper

Fixes

  • Allow the use of token address within the @token.* helpers
  • Fix ABI encoding for tuples
  • The @get helper can now return a single value from a function that returns many

v0.9.0

27 Nov 00:07
Compare
Choose a tag to compare

New features

  • New sequential interpreter, which makes it easier to write scripts in which one operation depends on the result of a previous one.
  • New tenderly module that can be used to fork the blockchain from a certain point, simulate transactions (from any address), and advance time. It introduces the following commands:
    • fork: Used to execute all the commands within a simulated blockchain fork from a specific block number and a specific address.
    • wait: Used to advance time and blocks in the simulated blockchain.
    • expect: Used to specify an expected outcome or test case.
  • New for command used to repeat many operations with different parameters.

v0.8.1

17 Nov 23:32
1ea125f
Compare
Choose a tag to compare

What's new?

Library enhancements:

  • New print command.
  • New autocompletion suggestions for Aragon agents and tokens retrieved via the @token helper.
  • New arithmetic operator ^ for exponentiation in mathematical calculations.
  • Add support to the goerli network on the aragonos module.
  • Add support to payable functions on the exec commands.
  • Reintroduce raw command.
  • Fix line endings in Windows.
  • Fix BigNumber edge case operations. Some numbers were not processed as BigNumbers, making some operations impossible.
  • Network changes were not considered when processing the subsequent commands and helpers, making some operations fail.
  • Fix underscored view function calls when using the call operator (::). For example: token-manager::MINT_ROLE().
  • Add improvements to set command.
  • Add improvements to @get helper.

Terminal enhancements:

  • You can attach a script to the URL, which will be preloaded in the terminal (example).
  • Gas is estimated by the wallet by default now.

v0.8.0

26 Oct 03:35
Compare
Choose a tag to compare

V0.8.0 - Modular Consigliere

This version adds a sort of intellisense feature that supports code completion and contextual suggestions that takes into account the previous command actions and the current typed parameters to help the user to fill the current command.

New features

  • Library enhancements:
    • Update command interface to add new functionality for building suggestions and completion items in a easier way.
    • General fixes.
    • Update unit tests and fixtures to work in Gnosis chain instead of Rinkeby.
  • Terminal enhancements:
    • Dynamic suggestion list that changes based on the previous commands.
    • Editor theme colors for commands, helpers, literals and keywords.
    • Command and helper suggestions based on the current imported modules.
    • Method signature suggestions given a specific contract address.
    • Specific identifiers suggestions based on the command and argument position being filled.
    • Improved connection handling.
    • Improved error display.

v0_8_0

v0.7.1

10 Sep 10:03
Compare
Choose a tag to compare

Patch Changes

  • 317a0a2: -
    • new-dao command fixes.
    • Allow to use new-token command outside of connect.
    • Fix implicit string-to-bytes conversion.
    • Refactor interpreter error handling.
    • Refactor aragonos Connector instantiation.
    • Add missing kernel-prefixed dao app bindings.

v0.7.0

04 Sep 15:36
Compare
Choose a tag to compare

v0.7.0 - Branchy Syntax

This version comprises a complete refactoring and restructuring of the library.

Embrace modularity. The evmcl command language (which is now called cas11) has been converted into a formal fully-fledged DSL (Domain-specific Language) comprise of composable and independent parser combinators that receive the raw cas11 script and produce the nodes of a AST (Abstract Syntax Tree) which will be later on processed by an interpreter (the evmcrispr).

The different commands and helpers have been moved to separated encapsulated modules following the separation of concerns principle. In this way, new web3 protocols can be supported and integrated more easily.

How to use

import { EVMcrispr, parseScript } from '@1hive/evmcrispr';

async function main() {
  const { ast, errors } = parseScript(script);

  if (errors.length) {
    // handle errors
  } else {
    const evmcrispr = new EVMcrispr(ast, ethersSigner)

    const actions = await evmcrispr.interpret();

    // execute actions
  }
}

New features

  • New switch <network name or id> command that allows you to dynamically switch the chain.

  • New load <module> [as <alias>] command that allows you to import the modules containing a set of commands and helpers. At the moment, there are two modules:

    • std: the core module which is not required to import. It contains the following:
      • Commands: load, exec and set and switch.
      • Helpers: @date, @get, @id, @ipfs, @me, @token and @token.balance.
    • aragonos: Aragon module that contains the following:
      • Commands: act, connect, forward, grant, install, new-dao, new-token, revoke and upgrade
      • Helpers: @aragonEns.

    When loading a module, you have access to all its commands and helpers. In the case of commands, you need to prefix the module name in order to use them.
    Also, it's not necessary to prefix the commands of a specific module when they're used inside a block expression of a command of the same module.
    Here's an example where we use the aragonos module to better understand these concepts:

      load aragonos as ar
      
      ar:connect 1hive token-manager voting (
      	install agent:new
      	grant voting token-manager ISSUE_ROLE voting
      )

    Note an alias (in this case "ar") has been set for the module. In order to use the connect command, we need to prefix it.
    Also note that the aragonos commands inside the connect block scope aren't prefixed.

  • New call operator <contractAddress>::<method>(<args>) to call read-only contract functions. Example:

     load aragonos as ar
    
     ar:connect myDAO (
     	set $var1 token-manager
     	exec token-manager::token() transfer(address,uint256) vault 2500e18
     	exec $var1::token() transfer(address,uint256) vault 2500e18
     	set $var2 @token(DAI)::decimals()
     )
    

    It also supports chainable calls. Here's an example:

      load aragonos as ar
    
      ar:connect myDAO (
      	set $var1 token-manager::token()::decimals()
      )
    

    At the moment it only supports calls to functions that return primitive data types.

  • @calc() helper has been deprecated in favor of native arithmetic expression operations that support priority parenthesis. Example: set $var1 (@token.balance(DAI, @me) * (5 - myContract::aMethodReturningNumber())).

  • Complete support of nested expression structures (e.g. arrays, block command expressions, call expressions, helper expressions, etc).

  • Support of nested connect commands that allow you to define DAO-to-DAO operations scripts and have access to different organizations' apps inside a scope.
    You can reference a different DAO's app by their name, address or nesting index. The format would be as follow: _<dao>:<app-identifier>.
    Example:

    load aragonos as ar
    ar:connect mainDAO (
        ar:connect subDAO tollgate token-manager voting (
       		 # It grants mainDAO's voting app permissions to create votes in
       		 # subDAO's voting app.
       	 grant _mainDAO:voting voting CREATE_VOTES_ROLE 
       		 # Here the nesting index "_1" is the same as "_myDAO".
       	 grant _1:voting token-manager MINT_ROLE
        )
    )
    
  • The forward <...path> ( <...commands> ) command is back. It allows you to customize the forward path by not having to define it in the connect command. This can be helpful when creating scripts that will be sent through a forwarding path composed of apps from different DAOs. Example:

    load aragonos as ar
    ar:connect mainDAO (
       ar:connect committeeDAO (
       	forward _mainDAO:token-manager token-manager (
       		...
       	)
       )
    )
  • Option arguments can now be used in-between commands. Example my-command --anOpt 1e18 anotherArg --anotherOpt 1e18 anotherArg.

  • Improved error handling logic that displays the location (line and column number) and type of the failed expression along with the error message.

  • Parser combinators implement error recovering logic which allows them to scan the whole script looking for the maximum number of syntax errors.

v0.6.0

01 Aug 19:03
Compare
Choose a tag to compare

New features

  1. It reads the ABI from Etherscan API, so we do not need to know the entire function signature to use the exec command
    • If we want to use this feature, we need to set the $etherscanAPI variable with a valid API key.
    • Now, instead of writing the entire signature, we can write the function name. Example exec @token(WETH) withdraw 40 instead of exec @token(WETH) withdraw(uint256) 40.
    • It supports EIP1822, EIP1967, and other kinds of proxies.
  2. We introduced @ipfs, @calc, and @get helpers.
    • The @ipfs helper can be used to obtain the CID hash of a string that has been pinned in Pinata. To use this feature, we need to set $ipfs.jwt with the Pinata JWT key. Example: set $foo @ipfs(Hello world).
    • The @calc helper allows calculating big number expressions using +, -, *, and /. It takes care of the order of the operations and accepts environment variables. Example: @calc(2+8e18*13/$bar).
    • We can use @get to get any value exposed in a contract. Example: set $abi name():(string); set $var @get($weth,$abi). It calls the name function of the WETH contract and returns the "Wrapped Ether" string.
  3. We added a new raw command that allows sending a transaction to an address with a custom data field.

v0.5.0

29 Jun 12:16
6d15ea1
Compare
Choose a tag to compare

New features:

  1. We restructured the EVMcrispr library in modules to make it easier to extend with other frameworks in the future.
    • We separated the code between the std (standard) module and the aragonos module.
    • The std module contains the generic exec command and the @token, @me, @id, and @date helpers.
    • The aragonos module contains all the Aragon-specific commands (connect, install, upgrade, grant, revoke, exec, and act) and the @aragonEns helper.
  2. We introduced @id and @date helpers.
    • The @id helper can be used to obtain the hash of a string
    • The @date helper is a more powerful helper than the @now helper (that we will not need to implement):
      • We can use @date(now) to get the current time
      • We can also use a date in ISO 8601 format to specify an exact date, for instance, @date(2022-02-02Z) to obtain the timestamp for 2nd February 2022.
      • We can also add or remove periods to those dates. Examples: @date(now,+3d) for three days from now, and @date(2015-07-30Z,-2y-4m) for 2 years and 4 months ago from the Ethereum genesis block date.
  3. We introduced major support to named parameters in commands.
    • New --oracle option in grant command, replacing the @params and @params.oracle helpers we had planned. It allows an EVMcrispr user to set up permissions only available when the oracle returns true. An excellent example of that is the 1hive token oracle Aragon app, which is an ACL oracle that returns true when the address that acts has a specific token.
      # grant any entity permission to create votes if they have a specific token
      grant ANY_ENTITY voting CREATE_VOTES_ROLE voting --oracle token-oracle.open
      
    • New --version option in command install, so we can choose to install a different version, not just the last one. Example:
      # install voting v1.0.0
      install voting:new @token(HNY) $support $quorum $duration --version 1.0.0
      
    • New positional options in command upgrade make it optional and allow to specify a specific version. Example:
      # upgrade voting to the latest version
      upgrade voting
      # downgrade voting to 1.0.0
      upgrade voting 1.0.0
      # upgrade voting to a different contract (be very careful with this one)
      upgrade voting 0x...
      
  4. We now allow multi-transaction sending scripts, so we can create many votes in many different DAOs in just one script.
    • This is the first version in which we can use EVMcrispr to execute any transaction in the blockchain, without having to be attached to a DAO. Do you want to claim and re-stake your Unipool rewards? Easy:
      # No DAO needed; these actions are performed directly from your address
      exec $contract getReward()
      exec $contract stake(uint256) @token.balance(@me)
      
    • You can also create many votes in the same script!
      connect dao1 token-manager voting (
         # <actions to normal Aragon DAO>
      )
      connect dao2 disputable-voting.open --context "Optional link" (
         # <actions to Gardens>
      )
      
    • On top of that, you can even interact with the DAO apps from your address without forwarding.
      connect dao1 (
         # Cast a vote on vote #1 directly from your address, voting yes
         exec voting vote 1 true true
      )
      
  • New option to command new to create DAOs: new dao <aragonId>.
    • It creates an empty DAO. Once available in the graph, you can install as many apps as you want and grant them permissions within a connect command.
    • Connecting to the DAO just after creating it does not work yet; it needs to be done in a different script.
  • New @aragonEns helper to find the addresses pointed by subdomains of aragonpm.eth and aragonid.eth. Real example used last week:
    set $repo @aragonEns(hooked-token-manager-no-controller.open.aragonpm.eth)
    exec $repo newVersion(uint16[3],address,bytes) [2,0,0] 0x7cdB48CBF25F4f044eEaE83187E3825Ae301C93d ipfs:Qma2cVx7i9eTu9VSBexWVbfqeS1qwKc8zFFnwV4zrjTMUJ
    
  • We migrated the UI to use Chakra React components, which will make it easier to expand the frontend next to the subsequent iterations.