Giter VIP home page Giter VIP logo

yul-log's Introduction

๐Ÿ“ฆ Yul Log ๐Ÿ“ฆ

Yul Log is a package designed to serve as an easy to use unified toolchain for writing and using Yul+ Contracts. It's named after the dessert, partially to fit with Truffle's theme.

Yul Log reads from a directory called "Yul+ Contracts" within the local context, and expects only files with the .yulp extension inside. It will then compile your contracts and put the artifacts in ./artifacts/contracts for hardhat, and for truffle it will transpile them to Yul and put them in your contracts directory, then use truffle to compile it down to useable artifacts.

Currently Truffle is supported and Hardhat is close by, alternatively you can just utilize the default created artifacts inside of your own framework. If you want to check out how to use Yul log with truffle check out my truffle box and if you have any questions or issues just raise an issue on this repo!

Installation

Simply install with node via

npm install -g yul-log

(sudo may be required depending on settings for a global installation)

After installing the package, run the following command to set up the development environment.

yul-log init

Now you are all set up and can write .yulp files inside of the Yul+ Contracts directory.

Commands

yul-log

This will compile .yulp contracts inside of a "Yul+ Contracts" Directory in the current context into a special json file with the following format into a "./build" folder inside the current context

{
    "_format": "Yul+ Artifact Format v0.0.1",
    "contractName" : filename,
    "abi" : abi,
    "bytecode" : bytecode,
    "deployedBytecode" : deployedBytecode,
}

You can then use this json file however you would like in your current project.

yul-log truffle

This will compile .yulp contracts inside of a "Yul+ Contracts" Directory at the root of the project into truffle artifacts, which can then be treated like regular truffle contracts when testing. Note that if you are using truffle make sure the following is in your truffle-config.js

      solc: {
      version: "0.8.10",    // Fetch exact version from solc-bin (default: truffle's version)
      language : "Yul",
      // 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
        optimizer: {
          enabled: true,
          runs: 200
        },

so that you can compile Yul, as this will be used to compile the transpiled Yul, giving you more control over options and optimizations. After compiling the contract into truffle artifacts, you can run truffle test to run tests with truffle as normal.

yul-log hardhat

This will compile .yulp contracts inside of a "Yul+ Contracts" Directory at the root of the project into hardhat solidity artifacts (Use sig"" to remain compatible). Command is still very much a WIP, however it will generate a partial artifact that fits with a hardhat Solidity artifact, and can be treated similarly. However this isn't fully supported at the moment so expect issues and frequent manual fixes.

yul-log's People

Contributors

0xkitsune avatar controlcpluscontrolv avatar

Stargazers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.