Skip to content

Instantly share code, notes, and snippets.

View casweeney's full-sized avatar
👨‍💻
Building Platforms

Coding Cas casweeney

👨‍💻
Building Platforms
View GitHub Profile
@casweeney
casweeney / English auction.sol
Created August 4, 2022 02:24 — forked from developeruche/English auction.sol
Solidity English Auction
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface IERC721 {
function safeTransferFrom(
address from,
address to,
uint tokenId
) external;
// SPDX-License-Identifier: MIT
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 the beneficiary
// amount of ethers in the smart contract
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.4;
contract Energy{
//have total supply
//transferrable
//name
//symbol
// SPDX-License-Identifier: GPL-3.0
pragma solidity 0.8.4;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/ERC20.sol";
contract Erc20Token is ERC20("Chop I Chop", "CIC") {
address owner;
constructor() {
owner = msg.sender;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Wallet {
address[] public approvers;
uint256 public quorum;
struct Transfer {
uint256 id;
uint256 amount;
address payable to;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
contract Exchange is ERC20 {
address public cryptoDevTokenAddress;
// Exchange is inheriting ERC20, becase our exchange would keep track of Crypto Dev LP tokens
constructor(address _CryptoDevtoken) ERC20("CryptoDev LP Token", "CDLP") {
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.9;
import "./IERC20.sol";
contract swap{
IERC20 token;
struct Order{
address _to;
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract Multisend {
address owner;
constructor() {
owner = msg.sender;
}
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
contract EthereumWallet {
address owner;
constructor() {
owner = msg.sender;
}
@casweeney
casweeney / VotingContract.sol
Created September 4, 2022 01:35
Simple Voting Contract
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @author Casweeney Ojukwu
contract PollingSystem {
/// @dev Created events for each transaction
event pollCreated(bool indexed status);
event voted(uint indexed candidateIndex);
event votingStarted(bool indexed _votingOpened);
event votingStopped(bool indexed _votingOpened);