How to use radspec - 2 common examples

To help you get started, we’ve selected a few radspec examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github floating / frame / main / contracts / contractMetadata / evaluateRadSpec.js View on Github external
const expression =
    metaData.userdoc &&
    metaData.userdoc.methods &&
    metaData.userdoc.methods[signature] &&
    metaData.userdoc.methods[signature].notice

  console.log(expression)
  if (!expression) return null

  const call = {
    transaction: { data, to },
    abi: metaData.abi
  }

  const result = await radspec.evaluate(expression, call, { eth: web3.eth })

  console.log(result)
  return result
}
github floating / frame / contractMetadata / evaluateRadSpec.js View on Github external
const expression = 
    metaData.userdoc && 
    metaData.userdoc.methods && 
    metaData.userdoc.methods[signature] &&
    metaData.userdoc.methods[signature].notice

  if (!expression) return null

  const call = {
    transaction: { data, to },
    abi: metaData.abi,
  }

  const web3 = new Web3(require('../main/provider'));
  return await radspec.evaluate(expression, call, {eth: web3.eth})
}

radspec

Radspec is a safe alternative to Ethereum's natspec

MIT
Latest version published 3 years ago

Package Health Score

46 / 100
Full package analysis

Popular radspec functions