This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
address <insert-your-address-here> { | |
module RockPaperScissors { | |
use std::signer; | |
use aptos_framework::randomness; | |
const ROCK: u8 = 1; | |
const PAPER: u8 = 2; | |
const SCISSORS: u8 = 3; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#![cfg_attr(target_arch = "wasm32", no_main)] | |
mod state; | |
use self::state::FungibleToken; | |
use async_graphql::{ | |
EmptySubscription, InputObject, Object, Request, Response, Schema, SimpleObject, | |
}; | |
use fungible::Operation; | |
use linera_sdk::base::{AccountOwner, Amount, ChainId}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Zefchain Labs, Inc. | |
// SPDX-License-Identifier: Apache-2.0 | |
#![cfg_attr(target_arch = "wasm32", no_main)] | |
mod state; | |
use self::state::FungibleToken; | |
use async_trait::async_trait; | |
use fungible::{Account, Message, Operation}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Zefchain Labs, Inc. | |
// SPDX-License-Identifier: Apache-2.0 | |
use linera_sdk::base::{Amount, Owner}; | |
use linera_sdk::views::{linera_views, MapView, RootView, ViewStorageContext}; | |
use thiserror::Error; | |
#[derive(RootView)] | |
#[view(context = "ViewStorageContext")] | |
pub struct FungibleToken { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Zefchain Labs, Inc. | |
// SPDX-License-Identifier: Apache-2.0 | |
use async_graphql::{InputObject, Request, Response}; | |
use linera_sdk::base::{Amount, ChainId, ContractAbi, Owner, ServiceAbi}; | |
use linera_sdk::graphql::GraphQLMutationRoot; | |
use serde::{Deserialize, Serialize}; | |
pub struct FungibleAbi; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Zefchain Labs, Inc. | |
// SPDX-License-Identifier: Apache-2.0 | |
#![cfg_attr(target_arch = "wasm32", no_main)] | |
mod state; | |
use self::state::FungibleToken; | |
use async_trait::async_trait; | |
use fungible::{Account, Message, Operation}; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Zefchain Labs, Inc. | |
// SPDX-License-Identifier: Apache-2.0 | |
use linera_sdk::base::{Amount, Owner}; | |
use linera_sdk::views::{linera_views, MapView, RootView, ViewStorageContext}; | |
use thiserror::Error; | |
#[derive(RootView)] | |
#[view(context = "ViewStorageContext")] | |
pub struct FungibleToken { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Copyright (c) Zefchain Labs, Inc. | |
// SPDX-License-Identifier: Apache-2.0 | |
use async_graphql::{InputObject, Request, Response}; | |
use linera_sdk::base::{Amount, ChainId, ContractAbi, Owner, ServiceAbi}; | |
use linera_sdk::graphql::GraphQLMutationRoot; | |
use serde::{Deserialize, Serialize}; | |
pub struct FungibleAbi; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// SPDX-License-Identifier: MIT | |
pragma solidity 0.8.7; | |
import "@zetachain/protocol-contracts/contracts/zevm/SystemContract.sol"; | |
import "@zetachain/protocol-contracts/contracts/zevm/interfaces/zContract.sol"; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
import "@zetachain/toolkit/contracts/BytesHelperLib.sol"; | |
contract NFT is zContract, ERC721 { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import React, { useEffect, useState } from "react"; | |
import contract from "./contracts/StackUp.json"; | |
import { ethers } from "ethers"; | |
const contractAddr = "0x5FbDB2315678afecb367f032d93F642f64180aa3"; | |
const abi = contract.abi; | |
function App() { | |
const [adminAddr, setAdminAddr] = useState("nil"); | |
const [currentAccount, setCurrentAccount] = useState(null); |
NewerOlder