Git Product home page Git Product logo

in-memory-stack's Introduction

In memory dynamic stack Github Actions Foundry License: MIT

A dynamic memory stack implementation in solidity.

Blueprint

lib
├─ forge-std — https://github.com/foundry-rs/forge-std
├─ openzeppelin-contracts — https://github.com/OpenZeppelin/openzeppelin-contracts
scripts
├─ 01_Deploy.s.sol — Simple Deployment Script
src
├─ InMemoryStack.sol — The library
test
└─ InMemoryStack.t.sol — Tests

Usage

Here's a list of the most frequently needed commands.

Build

Build the contracts:

$ make build

Clean

Delete the build artifacts and cache directories:

$ make clean

Compile

Compile the contracts:

$ make build

Test

To run all tests execute the following commad:

make tests

Alternatively, you can run specific tests as detailed in this guide.

Benchmarking

In the test testBenchmarkDynamicVsStatic() the gas costs of the dynamic stack vs a fixed sized array are compared.

The gas cost is approximately the same when 1000 elements are declared in the static array, but only 100 elements are effectively added.

Thus, try to use static arrays whenever possible to reduce gas overload.

About Us

Three Sigma is a venture builder firm focused on blockchain engineering, research, and investment. Our mission is to advance the adoption of blockchain technology and contribute towards the healthy development of the Web3 space.

If you are interested in joining our team, please contact us here.


in-memory-stack's People

Contributors

0x73696d616f avatar

Watchers

 avatar

Forkers

dashbaord202401

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.