Skip to content

Instantly share code, notes, and snippets.

View joeizang's full-sized avatar
😉

Joseph Izang joeizang

😉
View GitHub Profile
@joeizang
joeizang / 3_Ballot.sol
Created August 12, 2024 11:48
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// 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 {
@joeizang
joeizang / .prettierrc.json
Created August 12, 2024 11:33
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
{
"overrides": [
{
"files": "*.sol",
"options": {
"printWidth": 80,
"tabWidth": 4,
"useTabs": false,
"singleQuote": false,
"bracketSpacing": false
@page "/"
<h3>samplePage</h3>
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.8.2 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
* @custom:dev-run-script ./scripts/deploy_with_ethers.ts
*/
contract Storage {
@page "/"
<h3>samplePage</h3>
@joeizang
joeizang / tests...Ballot_test.sol
Created August 5, 2024 19:25
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
import "remix_tests.sol"; // this import is automatically injected by Remix.
import "hardhat/console.sol";
import "../contracts/3_Ballot.sol";
contract BallotTest {
bytes32[] proposalNames;
@joeizang
joeizang / .deps...npm...hardhat...console.sol
Created August 5, 2024 18:37
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.26+commit.8a97fa7a.js&optimize=false&runs=200&gist=
// SPDX-License-Identifier: MIT
pragma solidity >=0.4.22 <0.9.0;
library console {
address constant CONSOLE_ADDRESS =
0x000000000000000000636F6e736F6c652e6c6f67;
function _sendLogPayloadImplementation(bytes memory payload) internal view {
address consoleAddress = CONSOLE_ADDRESS;
/// @solidity memory-safe-assembly
@joeizang
joeizang / examples...auctions...blind_auction.vy
Created April 18, 2024 22:50
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.25+commit.b61c2a91.js&optimize=false&runs=200&gist=
# Blind Auction. Adapted to Vyper from [Solidity by Example](https://github.com/ethereum/solidity/blob/develop/docs/solidity-by-example.rst#blind-auction-1)
#pragma version ^0.3.10
struct Bid:
blindedBid: bytes32
deposit: uint256
# Note: because Vyper does not allow for dynamic arrays, we have limited the
# number of bids that can be placed by one address to 128 in this example
MAX_BIDS: constant(int128) = 128
@joeizang
joeizang / README.md
Last active February 3, 2024 01:37 — forked from leosuncin/README.md
Install Powerline on Ubuntu 20.04
  1. Install powerline sudo apt install powerline source /usr/share/powerline/bindings/bash/powerline.sh

  2. Download and install fonts git clone https://github.com/powerline/fonts.git && cd fonts && sh ./install.sh

  3. Add this lines to .bashrc file if bash is what you use. You could add to other files like .zshrc etc. I use bash so there. This ensures that this switch is automatic when you start bash

.bashrc > if [ -f /usr/share/powerline/bindings/bash/powerline.sh ]; then