Code Monkey home page Code Monkey logo

fnsa-contracts's Introduction

Sample Smart contracts for Finschia

This repository provides sample contracts that use Finschia's cosmwasm. We'll be providing many sample contracts in the future, but for now the focus is on how to utilize dynamic link.

Dynamic link is a new feature introduced in Finschia's cosmwasm that allows you to call functions of other contract directly from your contract code. For a detailed explanation of dynamic link, see link.

This README explains how to use Finschia's cosmwasm and provides example code. This repository was created to provide a reference for contract developer to understand and utilize Finschia's cosmwasm, especially dynamic link feature.

Contracts

consignment

  • consignment Simple implementation of consignment system model using dynamic link

auction

Compiling

$ docker run --rm -v "$(pwd)":/code \
  --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/contracts/{Contract}/target \
  --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
  cosmwasm/rust-optimizer:0.12.9 ./contracts/{Contract}

This will compile all contracts in the ./contracts/{Contract} like ./contracts/auction directory and output the stripped and optimized wasm code under the artifacts directory as output, along with a checksums.txt file.

Notice

cosmwasm/rust-optimizer currently has versions of both optimizers for two processor architectures: Intel/Amd 64-bits, and Arm 64-bits (these run natively on Mac M1 machines). However, the native Arm version produces different wasm artifacts than the Intel version. Given that that impacts reproducibility, non-Intel images and build artifacts contain a "-arm64" suffix(rust-optimizer-arm64), to differentiate and flag them. Arm images are released to ease development and testing on Mac M1 machines. For release / production use, only contracts built with the Intel optimizers must be used.

quoted from https://github.com/CosmWasm/rust-optimizer/tree/main#notice

Licenses

This repository is licensed under Apache 2.0

All specifications will always be Apache-2.0. All Sample contracts will also be Apache-2.0.

fnsa-contracts's People

Contributors

da1suk8 avatar dudong2 avatar loloicci avatar zemyblue avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

fnsa-contracts's Issues

Add github actions

Set up github actions so that the tests will work with CI.

Todo

  • check build
  • unittest
  • check if update schema

Add ci

Added sample smart contracts need to be checked with github action. So that, we can prevent human errors.

Todo

  • check build
  • unittest
  • check if update schema

Auction Contract - stuck before EndAuction

If the highest bidder does not call and pay for EndAuction, NFT is stuck and the seller loses it.
After a certain amount of time, it need an additional feature that allows seller to cancel an auction.

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.