Skip to content

Instantly share code, notes, and snippets.

View Ultra-Tech-code's full-sized avatar
:octocat:

Adewale IyanuOluwa Isaac Ultra-Tech-code

:octocat:
View GitHub Profile
@Ultra-Tech-code
Ultra-Tech-code / voting.sol
Created October 2, 2022 12:45
myVotingContract
//SPDX-License-Identifier:MIT
pragma solidity ^0.8.9;
contract voting{
//@author: BlackAdam
//This code allows a single poll to be created with 3 options (bad, average, good)
//@dev: the options can be inreased and cutomize
//note: the contracts needs to be redployed for another poll(else, you will mess up the initial poll)
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.8.0;
pragma experimental ABIEncoderV2;
contract Wallet {
address[] public approvers;
uint8 public quorum;
struct Transfer {
require("dotenv").config({ path: ".env" });
import { BytesLike } from "ethers";
import { ethers } from "hardhat";
// import * as dotenv from "dotenv";
// import IMultiSig from "../typechain-types/Imultisig.sol"
async function main() {
let provider = {
PrivateKey: process.env.PRIVATE_KEY as BytesLike,
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.4;
contract Vault{
// a contract where the owner create grant for a beneficiary;
//allows beneficiary to withdraw only when time elapse
//allows owner to withdraw before time elapse
//get information of a beneficiary
//amount of ethers in the smart contract
@Ultra-Tech-code
Ultra-Tech-code / library.sol
Created August 10, 2022 15:18
an arithmetic library with examples
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.8;
library arithmetic{
//Add two numbers together
function add(uint num1, uint num2) external pure returns(uint){
uint result = num1 + num2;
return result;
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.8;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/Pausable.sol";
contract wallet is Pausable{
@Ultra-Tech-code
Ultra-Tech-code / EnergyToken.sol
Last active August 6, 2022 15:46
A token created with solidity that has a 10% burn function
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.4;
contract Energy{
//have total supply
//transferrable
//name
//symbol
//decimal
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.4;
contract Vault{
// a contract where the owner create grant for a beneficiary;
//allows beneficiary to withdraw only when time elapse
//allows owner to withdraw before time elapse
//get information of a beneficiary
//amount of ethers in the smart contract
@Ultra-Tech-code
Ultra-Tech-code / Grant contract code
Created August 4, 2022 20:06
a contract where the owner create grant for a beneficiary
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.4;
contract Vault{
// a contract where the owner create grant for a beneficiary;
//allows beneficiary to withdraw only when time elapse
//allows owner to withdraw before time elapse
//get information of a beneficiary
//amount of ethers in the smart contract
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
contract fundContract{
mapping(address => uint) balances;
function deposit() public payable{
require(msg.value > 1, "Your deposit must be greater than 1 eth");