Skip to content

Instantly share code, notes, and snippets.

View tina1998612's full-sized avatar
:octocat:
DigitalNomad

李婷婷 Lee Ting Ting tina1998612

:octocat:
DigitalNomad
View GitHub Profile
#include <hello.hpp>
[[eosio::action]]
void hello::hi( name nm ) {
print_f("Name : %\n", nm);
}
[[eosio::action]]
void hello::check( name nm ) {
print_f("Name : %\n", nm);
func (s *SmartContract) CreateAsset(ctx contractapi.TransactionContextInterface, id string, color string, size int, owner string, appraisedValue int) error {
exists, err := s.AssetExists(ctx, id)
if err != nil {
return err
}
if exists {
return fmt.Errorf("the asset %s already exists", id)
}
asset := Asset{
using Neo;
using Neo.SmartContract;
using Neo.SmartContract.Framework;
using Neo.SmartContract.Framework.Native;
using Neo.SmartContract.Framework.Services;
using System;
namespace Helloworld
{
[ManifestExtra("Author", "Neo")]
scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
scriptSig: <sig> <pubKey>
;; use the SIP090 interface (testnet)
(impl-trait 'ST1HTBVD3JG9C05J7HBJTHGR0GGW7KXW28M5JS8QE.nft-trait.nft-trait)
;; define a new NFT. Make sure to replace MY-OWN-NFT
(define-non-fungible-token MY-OWN-NFT uint)
;; Store the last issues token ID
(define-data-var last-id uint u0)
;; Claim a new NFT
;; sip009-nft
;; A SIP009-compliant NFT with a mint function.
(impl-trait .sip009-nft-trait.nft-trait)
(define-constant contract-owner tx-sender)
(define-constant err-owner-only (err u100))
(define-constant err-token-id-failure (err u101))
(define-constant err-not-token-owner (err u102))
address 0x2 {
module Coin {
struct Coin {
value: u64,
}
}
}
import qualified Data.Text as T
import Language.Plutus.Contract hiding (when)
import Language.PlutusTx.Prelude
import Playground.Contract
-- | A 'Contract' that logs a message.
hello :: Contract BlockchainActions T.Text ()
hello = logInfo @String "Hello, world"
endpoints :: Contract BlockchainActions T.Text ()
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
let WHITELIST = {
"0x3dff349dae1d088f338cf3be70b801e5eeb65056": {
"voucher": {
"redeemer": "0x3Dff349dAE1d088f338cF3Be70B801E5EEb65056",
"stageId": 1,
"amount": 26,
"priceIndex": 0
},
"signature": "0x3e635e39db49eea29b0e3f927fcede66fe928f73641ce0e130cc623a3557d179766720364bfd5076682a0c69ab07e3167e7465e84a63e50c9e417d64da6e30681b"
},