Ideas to improve the original Loot contract

From Berenson on Discord:

FWIW, I reduced the estimated deploy gas cost by nearly half using the optimised contract “Name”. The significant change is that the data is stored in CSV string const instead of string[]. The Name author, zefram.eth, describes the optimisation here: https://twitter.com/boredGenius/status/1433587858862796803?s=20
Contract code here: Name (for Adventurers): NAME Token | 0xb9310af43f4763003f42661f6fc098428469adab

zefram.eth (trois, trois) (@boredGenius)
P.P.S. @dhof I have no idea why you put the word lists in storage instead of as constants. I optimized the loot contract such that the deploy cost is much lower (and therefore the number of words you can fit is much higher)

Twitter•09/03/2021
Ethereum (ETH) Blockchain Explorer
Name (for Adventurers): NAME Token | 0xb9310af43f4763003f42661f6fc0…
The Contract Address 0xb9310af43f4763003f42661f6fc098428469adab page allows users to view the source code, transactions, balances, and analytics for the contract address. Users can also interact and make transactions to the contract directly on Etherscan.

1 Like