Skip to content

Instantly share code, notes, and snippets.

View ngmachado's full-sized avatar
💭
in the æther

Axe ngmachado

💭
in the æther
View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity 0.8.10;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/IERC20.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/token/ERC20/extensions/IERC20Metadata.sol";
/*
Each operation you get the gas as token;
There is small change of ragnorok of your balance;
*/
@ngmachado
ngmachado / Drip.md
Created October 5, 2021 10:53
Drip.md

Drip Contract Friendly Review

Notice

This is a friendly code review and my personal comments.

  • Lock the contracts to a specific compiler version
  • Add license to all contracts
// SPDX-License-Identifier: MIT
pragma solidity 0.8.4;
import {
ISuperfluid,
ISuperToken
} from "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol";
import {
IConstantFlowAgreementV1
pragma solidity 0.7.6;
pragma experimental ABIEncoderV2;
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0/contracts/token/ERC721/ERC721.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0/contracts/utils/Counters.sol";
import "https://github.com/OpenZeppelin/openzeppelin-contracts/blob/v3.4.0/contracts/access/AccessControl.sol";
contract SuperERC721 is ERC721, AccessControl {
bytes32 public constant MINTER_ROLE = keccak256("MINTER_ROLE");
pragma solidity ^0.7.0;
contract superSpreader {
event sendEther(address indexed receiver, uint256 amount);
event deposit(address indexed sender, uint256 amount);
mapping(address => bool) private _transferDone;
constructor() payable {
pragma solidity >=0.6.0 <0.7.0;
interface IERC2429 {
function defineHardRecovery(bytes32 _rootTree) external;
}
/*
Example of a recovery account as DMS and Will.
This contract define a new root as a mandatory recovery. A mandatory recovrey dont have a wait time to be active. After the activation is set, only the peers can recovery the account. We can think as the analogic lawyers :) gthat can prove the incapacity of the user.
var etherWalletLib = require('ethereumjs-wallet');
var ethUtil = require('ethereumjs-util');
var BN = require('bn.js')
const Peer_Secret = ethUtil.keccak256('ABC');
const wallet = etherWalletLib.generate();
console.log(`Peer Original PrivateKey: ${wallet.getPrivateKeyString()}`);
console.log(`Peer Original PublicKey: ${wallet.getPublicKeyString()}`);
@ngmachado
ngmachado / override.sol
Created July 9, 2019 13:07
Override Method
pragma solidity ^0.5.0;
contract ObjectOriented {
event Debug(string msg);
constructor() public {
}
// Base method with two parameters
function A(address _addr, uint256 _value) public returns(uint256) {
@ngmachado
ngmachado / static-file-server
Last active February 3, 2017 12:37
bare-fileserver
package main
import (
"flag"
"log"
"net/http"
"path/filepath"
)
var (
@ngmachado
ngmachado / TextProgressBar.cs
Last active December 18, 2015 11:37 — forked from jorgenpt/TextProgressBar.cs
Text based progress bar for C#
using System;
using System.Collections.Generic;
namespace JPT
{
public class TextProgressBar : IDisposable
{
private int _progress;
private int _total;
private int _width;