The Two Faces of ERC-2612 AKA Permit
May I introduce you to ERC-2612? Permit. Maybe you’ve heard of it?The ProblemTLDR: ERC20 transfers require a spending approval transaction, which is costly (I just paid $5.33 in ETH for one, argh!). This is no bueno, mi famiglia, s'il vous plait.How can we avoid this?Option A) The most common pattern is to ask the user to approve a transaction of unlimited spending amount. This lets the contract just spend away! If you’re feeling uneasy about it, you should, ‘cause many have seen their w...
The Two Faces of ERC-2612 AKA Permit
May I introduce you to ERC-2612? Permit. Maybe you’ve heard of it?The ProblemTLDR: ERC20 transfers require a spending approval transaction, which is costly (I just paid $5.33 in ETH for one, argh!). This is no bueno, mi famiglia, s'il vous plait.How can we avoid this?Option A) The most common pattern is to ask the user to approve a transaction of unlimited spending amount. This lets the contract just spend away! If you’re feeling uneasy about it, you should, ‘cause many have seen their w...
"Advanced" Smart Contracting I
(Note: this article is intended to give readers a superficial understanding of things, with pointers to references that let you go deep into the sub-topics.) So you’ve been writing smart contracts for a while now, and you’ve gone beyond the basic counter and PFP NFT stuff, venturing into DeFi or GameFi or MusicFi or WhateverFi with contracts spanning over the 24KB, and you’ve deployed things going beyond the first iteration, and you’re now building new features on top and suddenly you realize...
"Advanced" Smart Contracting I
(Note: this article is intended to give readers a superficial understanding of things, with pointers to references that let you go deep into the sub-topics.) So you’ve been writing smart contracts for a while now, and you’ve gone beyond the basic counter and PFP NFT stuff, venturing into DeFi or GameFi or MusicFi or WhateverFi with contracts spanning over the 24KB, and you’ve deployed things going beyond the first iteration, and you’re now building new features on top and suddenly you realize...
Smart Contracting with Vyper and Ape
Hello, and welcome to another episode of… oh wait, wrong channel. Lets start over then! Tired of contract Solidity is SoVerbose, ICantTakeItAnymore, Etc { … } ? Yeah, me too. That’s why I decided to write EVM smart contracts with “the other” stack! LFG Vyper! What’s Vyper? It’s a Pythonic Smart Contract Language for the EVM. def is_it_nicer_to_write() → bool: return True It’s picking up attention thanks to some big DeFi projects (Hello Curve), and people looking beyond Solidity. This post giv...
Smart Contracting with Vyper and Ape
Hello, and welcome to another episode of… oh wait, wrong channel. Lets start over then! Tired of contract Solidity is SoVerbose, ICantTakeItAnymore, Etc { … } ? Yeah, me too. That’s why I decided to write EVM smart contracts with “the other” stack! LFG Vyper! What’s Vyper? It’s a Pythonic Smart Contract Language for the EVM. def is_it_nicer_to_write() → bool: return True It’s picking up attention thanks to some big DeFi projects (Hello Curve), and people looking beyond Solidity. This post giv...
Superfluid && Factory/Clones
Let’s say you have a SuperApp contract, of which you want to deploy multiple instances but with different arguments - e.g. your contract is a DeFi pool between token pairs like USDC/BTC, USDC/ETH, etc. Instead of manually deploying each contract, you can make use of the Factory/Clones pattern that some gigabrains have come up with!Sounds cool, but what exactly is this Factory/Clones pattern thing?The Factory pattern is a common design pattern that delegates the responsibility of creating inst...
Superfluid && Factory/Clones
Let’s say you have a SuperApp contract, of which you want to deploy multiple instances but with different arguments - e.g. your contract is a DeFi pool between token pairs like USDC/BTC, USDC/ETH, etc. Instead of manually deploying each contract, you can make use of the Factory/Clones pattern that some gigabrains have come up with!Sounds cool, but what exactly is this Factory/Clones pattern thing?The Factory pattern is a common design pattern that delegates the responsibility of creating inst...
Superfluid && Mainnet Fork
Are you building a dApp on top of Superfluid.finance? And now you want to test it with a Mainnet Fork instead of your local chain or testnets? But you don’t know how to do it? GM, you’ve landed at the right place.Deploying to a MainnetBefore deploying your Superfluid smart contract (SuperApp) to a Mainnet, you need to be whitelisted, AKA Superfluid needs to allow you to register your SuperApp with them. There are 2 options; which one you select depends on the architecture of your system. In t...
Superfluid && Mainnet Fork
Are you building a dApp on top of Superfluid.finance? And now you want to test it with a Mainnet Fork instead of your local chain or testnets? But you don’t know how to do it? GM, you’ve landed at the right place.Deploying to a MainnetBefore deploying your Superfluid smart contract (SuperApp) to a Mainnet, you need to be whitelisted, AKA Superfluid needs to allow you to register your SuperApp with them. There are 2 options; which one you select depends on the architecture of your system. In t...