This file contains 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.0; | |
contract StakingContract { | |
struct Stake { | |
uint256 amount; | |
uint256 timestamp; | |
} | |
mapping(address => Stake) private stakes; |
This file contains 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
function demo() { | |
console.log("This is a demo function in javascript"); | |
return; | |
} |
This file contains 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 ... | |
contract StakingContract { | |
... | |
} |
This file contains 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: SEE LICENSE IN LICENSE | |
pragma solidity 0.8.19; | |
import {Transaction} from "../multisig.sol"; | |
interface IMultisig { | |
function createTransaction(uint _amount, address _spender) external; | |
function getTransaction(uint id) external view returns (Transaction memory); | |
} |
This file contains 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; | |
// Create a contract called token where you will specify the name of the token, the total number of token | |
// that can be in circulation and have an allowList for addresses that can get your token. | |
contract Token { |
This file contains 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
/* | |
TODO: | |
Locate the address of USDC on ethereum mainnet, | |
1. Query the balance, the token decimal, the name, and the token symbol. | |
*/ | |
/* | |
// 3 things are needed to interact with a Smart contract: | |
1. Address | |
2. ABI |
This file contains 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
// Mayowa Obisesan | |
// A script that queries an ethereum account balance, transaction count and blockNumber on ethereum's mainnet, | |
// sepolia and goerli testnet | |
import { ethers } from 'ethers'; | |
const address: string = "0x298AAA9A0822eB8117F9ea24D28c897E83415440"; | |
const accountDetails = async (networkType: string) => { | |
const provider = ethers.getDefaultProvider(networkType); |
This file contains 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 {ethers} from 'ethers'; | |
const nodeProvider = ""; | |
const getAccountType = (code) => { | |
const provider = ethers.getDefaultProvider(nodeProvider); | |
const code = provider.getCode(code); | |
return code; | |
} |