Giter Site home page Giter Site logo

bydolson / security-oracle-smart-contracts Goto Github PK

View Code? Open in Web Editor NEW

This project forked from shentufoundation/security-oracle-smart-contracts

0.0 0.0 0.0 141 KB

Smart Contracts for CertiK Security Oracle

Home Page: https://bscscan.com/address/0xE7F15597B7594E1516952001f57d022bA799b479

License: MIT License

JavaScript 16.30% Solidity 83.70%

security-oracle-smart-contracts's Introduction

CertiK Security Oracle Smart Contracts

Decentralized real-time auditing for your smart contracts.

Usage

Follow the following example to integrate with Security Oracle smart contract on Binance Smart Chain, the smart contract address is 0xE7F15597B7594E1516952001f57d022bA799b479.

Currently we don't have Ethereum version yet due to the high gas fee. If you want to have it please submit an issue in current repo to let us know.

For complicated integrations we can check DeFiExample for a reference.

interface SecurityOracle {
  function getSecurityScore(
    address contractAddress,
    string calldata functionSignature
  ) external view returns (uint8);
}

contract MinimalExample {
  function secureCall() public {
    address securityOracleAddress = address(0xE7F15597B7594E1516952001f57d022bA799b479);

    address targetAddress = address(0x1234567);
    string functionSignature = "getPrice(string)";

    uint8 score = SecurityOracle(securityOracleAddress).getSecurityScore(
      targetAddress,
      functionSignature
    );

    // build your own check
    require(score > 100, "revert due to high security risk");

    ...proceed to call targetAddress/function
  }
}

Development

Prerequisite

yarn install

Interactive Debugging

yarn deploy

yarn console

Test

yarn test

Production

TRUFFLE_PRIVATE_KEY="<wallet-key>" TRUFFLE_RPC="<rpc-endpoint>" yarn deploy --network production

Note that truffle commands like truffle migrate/truffle deploy/etc would also require the environment variables.

security-oracle-smart-contracts's People

Contributors

bencao avatar muhanzou avatar boxi11 avatar dshe-certik avatar cleanunicorn avatar aiolos404 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.