Skip to content

Instantly share code, notes, and snippets.

View pakaplace's full-sized avatar

Parker Place pakaplace

View GitHub Profile

ERC-1400 Base

This base transfer check provides a method for checking static restrictions as well as transfer restrictions. This is in line with ERC-902 proposal.

function canSend(address tokenHolder, uint256 amount) external view returns (byte ESC, bytes32 reason);
function canSend(address from, address to, uint256 amount, bytes data) external view returns (byte ESC, bytes32 reason);

ERC-1400 Extension for differentiated ownership

@nolanlawson
nolanlawson / protips.js
Last active February 4, 2024 18:06
Promise protips - stuff I wish I had known when I started with Promises
// Promise.all is good for executing many promises at once
Promise.all([
promise1,
promise2
]);
// Promise.resolve is good for wrapping synchronous code
Promise.resolve().then(function () {
if (somethingIsNotRight()) {
throw new Error("I will be rejected asynchronously!");