Coder Social home page Coder Social logo

aikenexploration's Introduction

Aiken exploration

Functionality Overview

This is a simple smart contract that requires a specific signature to unlock funds. When locking the funds, the datum captures the signature that can unlock. When unlocking and executing the contract, validates that the signature in the datum is present in the signers of the transaction, thus releasing the funds.

Instructions

Building

aiken build

Testing

There are two simple test: one that validates the contract pays to the signature in the datum and one that validates it doesn't pay if is not signed by the singature in the datum.

To run all tests, simply do:

aiken check

You should get:

    ┍━ assignment ━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━
    │ PASS [mem: 36266, cpu: 12321269] pays_to_owner
    │ PASS [mem: 39403, cpu: 13428495] doesnt_pay_if_not_owner
    ┕━━━━━━━━━━━━━━━━━━━━━━━━━━━ 2 tests | 2 passed | 0 failed

Run on-chain (Testnet/Mainnet)

(Note: The scripts use blockfrost to interact with cardano blockchain, it requires a project id in the env variable BLOCKFROST_PROJECT_ID )

Optional: generate credentials

  deno run --allow-net --allow-write generate-credentials.ts

Lock funds

deno run --allow-net --allow-read --allow-env lock-funds.ts

Unlock funds

deno run --allow-net --allow-read --allow-env unlock-funds.ts <lock transaction Id>

aikenexploration's People

Contributors

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