
today i go over the smart contract i created two years ago for a nft collection celebrating the sunset of filmmaker dao.
it was called the “storytelling card”, and folks were able to generate their unique nfts on the fly by inputting an int up to 1337:

my contract was loosely based on the loot project, and it deployed a (sort of) generative erc-721 collection in the ethereum mainnet (for the cost of ~$2k or so). here is the source code.

it was a fun project 😊…
https://open.spotify.com/track/5NFZLpFoP4fVWjmc007A5k?si=cc2f1c312fcb4a32
the idea of this collection was to create unique, randomized, and limitless narratives generated and stored on-chain, as a novel approach to storytelling.
here are some of my favorites:









do you see the pattern?
if you are an engineer, could you guess how these cards were (pseudo-)randomly generated?
long story short, the dao was about to dissolve because our investor backed off. so this project was my farewell token for the community.
for this reason, i wanted the contract to be immutable and self-contained. there was no reason to deploy it on a proxy, because it wasn’t supposed to be upgraded. and… there was no payable function.
yeap, you read it right: the contract was not for profit. part of the narrative was that it was never meant to be cashed out (sort of an easter egg - but also the sort of thing you only do once in life and during a bull market…).

i also remember that the contract size limit hit hard during my first attempt to deploy it to the ethereum mainnet (or when i was testing it on rinkeby). i had to move things around to fit the size limit of 24577 bytes. i customized (and consequently, prettified) every canonical library before everything was imported.

and, off-course, i needed a nice intro =p:

now, the contract was a pretty straightforward erc-721 instance, with the sale price intentionally hard-coded:

the magick trick was carried out by ten arrays that would mesh together, creating the narratives: genres, medium, cities, archetypes, verbs, objects, titles, adjectives, locations, and, of course, colors.

the pseudo-random function was very simple and predictable, with the tokenID as the input string:

to create a card’s generative SVG image on-chain, a function called tokenURI was crafted, outputting an array composed of one element of each of the sets above, plus some image customization (this part needed some work):

the last pieces of the contract were the mintCard and ownerClaim methods:

at that time, foundry wasn’t a thing, so i used hardhat.
here was the config file (with PRIVATE_KEY , API_ENDPOINT, API_ETHERSCAN in an .env file):

if you are not a blockchain developer, don’t worry, all you would need to do to compile the contract was:
npx hardhat compile
and then deploy with a simple javascript script:
npx hardhat run scripts/deploy.js

all right, here is some teasing, my dear anon.
if you are puzzled about how i ended up writing this collection for filmmaker dao, here is how everything started, during the bull of summer’21…
https://story.mirror.xyz/gbwXf_IOm4BkUNmWYWz5M-47Te8ELuQngClR8iHFxDU
crypto can be wild…

today i go over the smart contract i created two years ago for a nft collection celebrating the sunset of filmmaker dao.
it was called the “storytelling card”, and folks were able to generate their unique nfts on the fly by inputting an int up to 1337:

my contract was loosely based on the loot project, and it deployed a (sort of) generative erc-721 collection in the ethereum mainnet (for the cost of ~$2k or so). here is the source code.

it was a fun project 😊…
https://open.spotify.com/track/5NFZLpFoP4fVWjmc007A5k?si=cc2f1c312fcb4a32
the idea of this collection was to create unique, randomized, and limitless narratives generated and stored on-chain, as a novel approach to storytelling.
here are some of my favorites:









do you see the pattern?
if you are an engineer, could you guess how these cards were (pseudo-)randomly generated?
long story short, the dao was about to dissolve because our investor backed off. so this project was my farewell token for the community.
for this reason, i wanted the contract to be immutable and self-contained. there was no reason to deploy it on a proxy, because it wasn’t supposed to be upgraded. and… there was no payable function.
yeap, you read it right: the contract was not for profit. part of the narrative was that it was never meant to be cashed out (sort of an easter egg - but also the sort of thing you only do once in life and during a bull market…).

i also remember that the contract size limit hit hard during my first attempt to deploy it to the ethereum mainnet (or when i was testing it on rinkeby). i had to move things around to fit the size limit of 24577 bytes. i customized (and consequently, prettified) every canonical library before everything was imported.

and, off-course, i needed a nice intro =p:

now, the contract was a pretty straightforward erc-721 instance, with the sale price intentionally hard-coded:

the magick trick was carried out by ten arrays that would mesh together, creating the narratives: genres, medium, cities, archetypes, verbs, objects, titles, adjectives, locations, and, of course, colors.

the pseudo-random function was very simple and predictable, with the tokenID as the input string:

to create a card’s generative SVG image on-chain, a function called tokenURI was crafted, outputting an array composed of one element of each of the sets above, plus some image customization (this part needed some work):

the last pieces of the contract were the mintCard and ownerClaim methods:

at that time, foundry wasn’t a thing, so i used hardhat.
here was the config file (with PRIVATE_KEY , API_ENDPOINT, API_ETHERSCAN in an .env file):

if you are not a blockchain developer, don’t worry, all you would need to do to compile the contract was:
npx hardhat compile
and then deploy with a simple javascript script:
npx hardhat run scripts/deploy.js

all right, here is some teasing, my dear anon.
if you are puzzled about how i ended up writing this collection for filmmaker dao, here is how everything started, during the bull of summer’21…
https://story.mirror.xyz/gbwXf_IOm4BkUNmWYWz5M-47Te8ELuQngClR8iHFxDU
crypto can be wild…

on hacking systematically with foundry
tl; drtoday i go over some systems i’ve created in foundry for solving blockchain security challenges. i tend to indulge myself with a pristine code organization && logic. in this particular case, i am pretty proud of my methodology for running exploits, tests, and submission scripts (you can see it for yourself, for instance, with my solution for ethernaut’s wargames). in addition, you can also find some experiments in this repository.🎶 today’s moodhttps://open.spotify.com/track/2B3D38o8GaX...

on running your own goerli validator
tl; drtoday i go over how to set a goerli validator with geth and prysm, both locally or using (docker) containerization. the code in this post is available here.🎶 today’s moodhttps://open.spotify.com/track/1sotD6Cn8aOtUsL0bd5HTJ?si=ec5ea69d52b84dbcwhy run a testnet node validatorall right, anon, if you are serious about being a blockchain leet h4xoor developoor buildoor, you gotta run your own node at some point in your life. this way, you will able to understand the many pieces of the ethe...

on cowsol, my arb solver for cow protocol
tl; drtoday i go over one of my MEV bots, cowsol, which runs arbitrage strategies for CoW protocol. set a nice soundtrack, grab your favorite beverage, and solve the puzzles with me.🎶 today’s moodhttps://open.spotify.com/track/4Y2W4zKa3q72ztbkA0r8Va?si=c79621ab86ca4b95🐮🧩 piece #1: coincidence of wants💡 the cow protocol is a fully permissionless trading protocol that uses this novel idea of batch auctions to find prices and maximize liquidity, the “coincidence of wants”.🫱🏻🫲🏽 put it si...

on hacking systematically with foundry
tl; drtoday i go over some systems i’ve created in foundry for solving blockchain security challenges. i tend to indulge myself with a pristine code organization && logic. in this particular case, i am pretty proud of my methodology for running exploits, tests, and submission scripts (you can see it for yourself, for instance, with my solution for ethernaut’s wargames). in addition, you can also find some experiments in this repository.🎶 today’s moodhttps://open.spotify.com/track/2B3D38o8GaX...

on running your own goerli validator
tl; drtoday i go over how to set a goerli validator with geth and prysm, both locally or using (docker) containerization. the code in this post is available here.🎶 today’s moodhttps://open.spotify.com/track/1sotD6Cn8aOtUsL0bd5HTJ?si=ec5ea69d52b84dbcwhy run a testnet node validatorall right, anon, if you are serious about being a blockchain leet h4xoor developoor buildoor, you gotta run your own node at some point in your life. this way, you will able to understand the many pieces of the ethe...

on cowsol, my arb solver for cow protocol
tl; drtoday i go over one of my MEV bots, cowsol, which runs arbitrage strategies for CoW protocol. set a nice soundtrack, grab your favorite beverage, and solve the puzzles with me.🎶 today’s moodhttps://open.spotify.com/track/4Y2W4zKa3q72ztbkA0r8Va?si=c79621ab86ca4b95🐮🧩 piece #1: coincidence of wants💡 the cow protocol is a fully permissionless trading protocol that uses this novel idea of batch auctions to find prices and maximize liquidity, the “coincidence of wants”.🫱🏻🫲🏽 put it si...
影森のゴーストシェル
影森のゴーストシェル
Share Dialog
Share Dialog

Subscribe to bt3gl's symposium

Subscribe to bt3gl's symposium
<100 subscribers
<100 subscribers
No activity yet