GithubHelp home page GithubHelp logo

refcell / op-club-sqrt Goto Github PK

View Code? Open in Web Editor NEW

This project forked from kadenzipfel/op-club-sqrt

0.0 1.0 0.0 5.13 MB

Solution for the Optimizoor club's sqrt challenge

License: MIT License

Solidity 100.00%

op-club-sqrt's Introduction

Optimizor Club SQRT challenge

This repo contains my solution to the Optimizor Club SQRT challenge.

In the SQRT problem your contract is given an array of Fixed18 numbers, and it must return the square root of each number with an error margin of 10^-5. The challenge contract can be found at 0x2747096ff9e0fce877cd168dcd5de16040a4ab85.

The interface that your solution contract must adhere to is below. The sqrt function will be called by the challenge contract when you call its challenge function.

interface ISqrt {
   function sqrt(Fixed18[INPUT_SIZE] calldata) external view returns (Fixed18[INPUT_SIZE] memory);
}

Test

This solution is written in Huff, so you will need huffc installed to compile it.

Note In order to use the huff compiler within foundry tests / scripts, FFI must be enabled. If you'd like to read into what this repo uses FFI for before running anything, see foundry-huff and huff-rs.

To test locally:

$ LOCAL=true forge test

op-club-sqrt's People

Contributors

leonardoalt avatar clabby avatar hrkrshnn avatar kadenzipfel avatar

Stargazers

Roman avatar

Watchers

 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.