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...
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...
Degeneer and DeFi Support
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...
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...
Share Dialog
Share Dialog
Degeneer and DeFi Support

Subscribe to omnifient

Subscribe to omnifient
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 gives a brief overview of the ecosystem, and takes you from 0 to 100 faster than Usain Bolt.
So, how does this compare with the Solidity ecosystem? Here’s a very rough comparison table:

Now let’s quickly go through the main tools, so you know what’s what:
Vyper: as mentioned, it’s how you write the smart contracts. That means you’re gonna have the docs open all the time. Here’s a nice intro to learn how to write Vyper: the definitive 0 to 1 guide.
Brownie: the OG development and testing framework, actually written in python (but supports Solidity contracts).
ApeWorx: a newer alternative for developing contracts. While the focus is mainly on Vyper contracts, it also supports Solidity. Here’s a nice intro to Ape.
Ganache: also an OG tool, for spinning up your own node, and testing locally. Ganache is also agnostic to how your contracts are written.
It’s also worth mentioning Titanoboa, since it’s under the Vyper team’s umbrella, which is a very new Vyper interpreter with a bunch of features!
Ok, here we go. Start by ensuring you got an up to date python --version installed (currently. anything >= 3.10 is new-ish).
Create a virtual environment, and activate it
python -m venv <my-project>
cd <my-project>
source bin/activate
then install ape and vyper using pip pip install vyper eth-ape
freeze the packages cause it’s a good practice pip freeze > requirements.txt
run ape --version
If you get an output with something like 0.6.10, then great, you got ape running!
Now it’s time to start the ape project: ape init
Configure ape now, or later, up to you. If you do it now, you’ll want to familiarize with the docs
Now go and write some code
touch contracts/hello.vy
# and add this into hello.vy
@external
def hello() -> bool:
return True
Then you can ape compile -s. Things will be successful if it outputs the deployment bytecode size.
Now you’re ready to learn the language and write Vyper contracts!
Once you’re done with the contracts, it’s time to test! Note: the Vyper docs talk about Brownie and Ethereum Tester, but I prefer using Ape - follow its docs.
https://docs.apeworx.io/ape/stable/userguides/testing.html
Finally, time to run scripts to deploy things. Again, we use Ape for that.
https://docs.apeworx.io/ape/stable/userguides/scripts.html
You might want to deploy locally on a mainnet fork, I like using Foundry’s Anvil for that.
And that’s pretty much it, we’ve covered the basics to get started building with Vyper and Ape.
Many people have written about Vyper, and they did a better job than me. Check their stuff.
https://github.com/zcor/vyper-dev
Need real time help? Join Vyper’s discord and Ape’s discord channels.
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 gives a brief overview of the ecosystem, and takes you from 0 to 100 faster than Usain Bolt.
So, how does this compare with the Solidity ecosystem? Here’s a very rough comparison table:

Now let’s quickly go through the main tools, so you know what’s what:
Vyper: as mentioned, it’s how you write the smart contracts. That means you’re gonna have the docs open all the time. Here’s a nice intro to learn how to write Vyper: the definitive 0 to 1 guide.
Brownie: the OG development and testing framework, actually written in python (but supports Solidity contracts).
ApeWorx: a newer alternative for developing contracts. While the focus is mainly on Vyper contracts, it also supports Solidity. Here’s a nice intro to Ape.
Ganache: also an OG tool, for spinning up your own node, and testing locally. Ganache is also agnostic to how your contracts are written.
It’s also worth mentioning Titanoboa, since it’s under the Vyper team’s umbrella, which is a very new Vyper interpreter with a bunch of features!
Ok, here we go. Start by ensuring you got an up to date python --version installed (currently. anything >= 3.10 is new-ish).
Create a virtual environment, and activate it
python -m venv <my-project>
cd <my-project>
source bin/activate
then install ape and vyper using pip pip install vyper eth-ape
freeze the packages cause it’s a good practice pip freeze > requirements.txt
run ape --version
If you get an output with something like 0.6.10, then great, you got ape running!
Now it’s time to start the ape project: ape init
Configure ape now, or later, up to you. If you do it now, you’ll want to familiarize with the docs
Now go and write some code
touch contracts/hello.vy
# and add this into hello.vy
@external
def hello() -> bool:
return True
Then you can ape compile -s. Things will be successful if it outputs the deployment bytecode size.
Now you’re ready to learn the language and write Vyper contracts!
Once you’re done with the contracts, it’s time to test! Note: the Vyper docs talk about Brownie and Ethereum Tester, but I prefer using Ape - follow its docs.
https://docs.apeworx.io/ape/stable/userguides/testing.html
Finally, time to run scripts to deploy things. Again, we use Ape for that.
https://docs.apeworx.io/ape/stable/userguides/scripts.html
You might want to deploy locally on a mainnet fork, I like using Foundry’s Anvil for that.
And that’s pretty much it, we’ve covered the basics to get started building with Vyper and Ape.
Many people have written about Vyper, and they did a better job than me. Check their stuff.
https://github.com/zcor/vyper-dev
Need real time help? Join Vyper’s discord and Ape’s discord channels.
<100 subscribers
<100 subscribers
No activity yet