Giter VIP home page Giter VIP logo

fcl-contracts's Introduction

FCL Contracts

FCLCrypto.cdc and FlowInteractionTemplateAudit.cdc are contracts which revolve around Interaction Templates and can be used by the Flow Client Library (FCL).
Interaction Templates are a concept to alleviate interacting with a contract by handing out descriptive information in a defined textual data structure. Further information can be obtained by following the link above.

FCLCrypto.cdc allows to verify the signatures for an account and check that the combined weight of the account keys reaches signing power.
It provides the function verifyUserSignatures for user signatures and the function verifyAccountProofSignatures for account proof signatures.
These functions are accessible by the provided scripts verifyUserSignatures.cdc and verifyAccountProofSignatures.cdc.

In order to add Interaction Templates which shall be audited, use the FlowInteractionTemplateAudit.cdc contract and add the template by executing the transaction add-audit.transaction.cdc and provide the template id string.
In order to revoke added audits, call the revoke-audit.transaction.cdc transaction.

It's important to note that by executing add-audit.transaction.cdc, you've become an Interaction Template Auditor, and own an AuditManager resource. All audits which you add are bound to this resource.

You can find two scripts, get-audits-from-audit-manager.script.cdc returns a string array containing the keys for all the audits bound to the AuditManager resource, while get-has-audited-from-audit-manager.script.cdc returns a Boolean signaling if the audit manager has audited the given template id.
Further utility functions in the contract are getAuditsByAuditor which takes an auditor address and returns the audits done by that auditor, and getHasTemplateBeenAuditedByAuditors, which allows to check for multiple auditor addresses if the given template id has been audited by them.

Contract Addresses

Name Testnet Mainnet Sandbox
FCLCrypto 0x74daa6f9c7ef24b1 0xb4b82a1c9d21d284 0x57b2b89759200677
FlowInteractionTemplateAudit 0xf78bfc12d0a786dc TBD TBD

fcl-contracts's People

Contributors

ggpt-labs avatar gregsantos avatar jeffreydoyle avatar justinbarry avatar psiemens avatar sideninja avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Forkers

diegofornalha

fcl-contracts's Issues

Prepare Repo for Open Source

The following checklist gives a comprehensive action items that should be taken before making the repository public.

  • Repository info

    • Add repo description
    • Update website to flow.com
    • Add relevant repository tags (i.e. blockchain js, etc)
  • General security audit

    • Searching for references to internal IP (look into ways to automate search)
    • Remove secrets
    • Remove any mentions of NBA, Moments, USDT, Circle, any other partner names
  • Define merge workflow

    • Branch rules:
      • main
        • Require pull request reviews before merging (1 approving review)
          • Require review from Code Owners
        • Require status checks to pass before merging
          • Require branches to be up to date before merging
        • Require linear history
        • Restrict who can push to matching branches
          • Choose onflow/flow team
  • Add necessary team members, adjust access levels

    • onflow/flow-admin ⇒ Admin access
    • onflow/flow ⇒ Write access

The following changes should be made in a new branch (i.e. onflow-migration) and merged into main as a PR. Example: onflow/flow#1

Deprecate the user tag

Context

The user tag has been deprecated from the Flow protocol long time ago (onflow/flow-go#2171). It was used by FCL verification contract (https://github.com/onflow/fcl-contracts/blob/0dd0c7d/cadence/contracts/FCLCrypto.cdc#L140) during a transition period to give time for wallets and developers to update and it should be removed afterwards (in particular for the account proof verification).

It would be great to:

  • deprecate the user constant "FLOW-V0.0-user" from the contract
  • make the contract accept a parameter tag to verify user signatures (FCL-JS would set the tag it needs)
  • keep only "FCL-ACCOUNT-PROOF-V0.0" for account proof verifications
  • update FCL-JS accordingly. FCL-JS can either:
    • force everyone to use "FCL-USER-V0.0" for user signatures
    • allow dapps to set their own tags (preferred to separate domains)

I let the FCL-JS experts decide on what's the best user-friendly change to implement.

Fix CI to run Go and JS Tests

CI currently fails to execute Go and JS tests. We need to get it to run both suites and exit successfully if both pass.

Prepare FCL Contracts Repo for Open Source

Context

We need to prepare the fcl contracts repo for open source.

Definition of Done

Preparation for Open Source

  • Repository info

    • Add repo description
    • Update website to flow.com
    • Add relevant repository tags (i.e. blockchain js, etc)
  • General security audit

    • Searching for references to internal IP (look into ways to automate search)
    • Remove secrets
    • Remove any mentions of NBA, Moments, USDT, Circle, any other partner names
  • Define merge workflow

    • Branch rules:
      • main
        • Require pull request reviews before merging (1 approving review)
          • Require review from Code Owners
        • Require status checks to pass before merging
          • Require branches to be up to date before merging
        • Require linear history
        • Restrict who can push to matching branches
          • Choose onflow/flow team
  • Add necessary team members, adjust access levels

    • onflow/flow-admin ⇒ Admin access
    • onflow/flow ⇒ Write access

The following changes should be made in a new branch (i.e. onflow-migration) and merged into main as a PR. Example: onflow/flow#1

Add JS tests

In order to showcase that devs may also write tests using Javascript, please convert Go tests to JS using the flow JS testing suite.

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.