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: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
/** | |
* @title Ballot | |
* @dev Implements voting process along with vote delegation | |
*/ | |
contract Ballot { | |
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
pragma solidity ^0.8.0; // version of solidity compiler to compile the code | |
contract HelloWorld{ | |
uint number; // variable to store integer | |
// function taking parameter from user and storing in variable | |
function storeNumber(uint _number) |
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 { | |
Account, | |
clusterApiUrl, | |
Connection, | |
PublicKey, | |
sendAndConfirmTransaction, | |
SystemProgram, | |
Transaction, | |
} from '@solana/web3.js'; |
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
const web3 = require('@solana/web3.js'); | |
const splToken = require('@solana/spl-token'); | |
(async () => { | |
//create connection to devnet | |
const connection = new web3.Connection(web3.clusterApiUrl("devnet")); | |
//generate keypair and airdrop 1000000000 Lamports (1 SOL) | |
const myKeypair = web3.Keypair.generate(); |