Skip to content
プロジェクト

shentufoundation/security-oracle-smart-contracts

GitHubで見る

概要

Smart Contracts for Shentu Security Oracle

セキュリティ・プライバシー

この数値の測り方

計測したスター増加

24時間
0
7日間
0
15日間
0
1か月
履歴を収集中

期間ごとの純増数です。期間は重複しており、日別の値ではありません。未計測の値は空欄です。スター数は注目度の指標であり、品質の保証ではありません。

Shentu 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.

関連プロジェクトを探す

読み込み中…