Skip to content

Instantly share code, notes, and snippets.

View leonpw's full-sized avatar
🏠
Working from home

Leon de Pruyssenaere de la Woestijne leonpw

🏠
Working from home
View GitHub Profile
@leonpw
leonpw / GasContract.json
Last active February 28, 2023 16:02
Gas optimization team 8. With modified hardhat.config.js and GasContract.json
{
"_format": "hh-sol-artifact-1",
"contractName": "GasContract",
"sourceName": "contracts/Gas.sol",
"abi": [
{
"inputs": [
{
"internalType": "address[5]",
"name": "_admins",
@leonpw
leonpw / QueryContract.sol
Created February 26, 2023 20:24
Example function selector as a member of a function. Should revert if ERC20 transfer is passed.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.4.22 <0.9.0;
contract QueryContract {
event Selector(bytes4);
function query(bytes memory data, function(address,uint) external test) public {
emit Selector(test.selector);
@leonpw
leonpw / INITHARDHAT.md
Created December 8, 2022 12:43
Inits a default hardhat tempolate with TS and Mocha
mkdir project
cd project
yarn init -2
yarn config set nodeLinker node-modules
yarn add hardhat --dev
rm README.md
yarn hardhat init
yarn add mocha --dev
code .
@leonpw
leonpw / brownie_privatekey.txt
Created August 30, 2022 06:46
The privatekeys for the mnemonic brownie
If you ever want to figure out what the private keys are for the mnemonic "brownie", here they are;
Available Accounts
==================
(0) 0x66aB6D9362d4F35596279692F0251Db635165871 (100 ETH)
(1) 0x33A4622B82D4c04a53e170c638B944ce27cffce3 (100 ETH)
(2) 0x0063046686E46Dc6F15918b61AE2B121458534a5 (100 ETH)
(3) 0x21b42413bA931038f35e7A5224FaDb065d297Ba3 (100 ETH)
(4) 0x46C0a5326E643E4f71D3149d50B48216e174Ae84 (100 ETH)
(5) 0x807c47A89F720fe4Ee9b8343c286Fc886f43191b (100 ETH)
@leonpw
leonpw / Allow non-admin use of Docker.ps1
Created August 14, 2018 09:44
Allow run docker from non-admin
# Fix docker security for VSTS-agents
# get access control list of pipe
$PipeAcl = [System.IO.Directory]::GetAccessControl('\\.\pipe\docker_engine')
# creat new access control identifier
$secident = new-object -Typename System.Security.Principal.SecurityIdentifier('S-1-2-0')
# Create new access control with identifier
$PipeAccessRule = New-Object -TypeName System.Security.AccessControl.FileSystemAccessRule($secident, 'FullControl', 'Allow')
_