🔺Team1 Bloodloop Game Nights - Philippines 🇵🇭
@BloodLoopGAME launches later this month and we will be hosting 6 IRL game nights in one week across the Philippines.
Team1 supports projects that build on Avalanche.
Registration and event invites below 👇
I gave a talk about this at a hackerhouse last year. Some patterns I liked mostly when using anchor:
- Split your instructions into 1 file per instruction. The file should include the accounts struct, a separate verification function and business logic
- again separate state accounts into their own files
- when writing anchor constraints, try to do as much as possible just using 'has_one=', and use custom errors
- more complex constraints should go into the verification function
- look at @multisig code for good coding references
- use invariants. thats a function that you can call at the end of your instruction to assert some properties
- while invariants are static (always-trueisms), you can also write assertions for your specific instruction. For example, at the start of a deposit instruction, take the current treasury amount, and at the end of the instruction make sure the new amount is more than at the start.
- use a state variable for your program that allows you to halt operations. e.g. different states for halting all instructions, halting new deposits, and not halting anything, e.g. normal operation. Only callable by admin, different to the upgrade authority. So that during an attack you can stop an attack with one instruction call, as opposed to a program upgrade during the most stressful moment ever
- if you want to be future and past-compatible, you can include single 0-bytes in your structs (ideally at the end). When you want to add a new type, wrap it as an Option<>, which is one 0-byte in the None case.
- if possible, place static size fields at the beginning and variable size fields at the end of your on-chain structures, making indexing easier
- dont use strings, or variable length byte arrays in PDA seeds
- avoid using remaining accounts, lots of bugs there
- use noop/self cpi pattern for cheap logging
- monitor your on-chain program
- think about write-locking. When your program might experience extreme usage as times (airdrops, nft mints, ...), make sure it's written in a way that there isn't a single account every user needs to write lock
- use safe math, and keep your math simple
Join me in the #CoreIgnition incentive program! Let's get ignited as a team
Bridge to @CoreDAO_Org, and interact with Core Chain ecosystem dApps to be eligible.
https://t.co/JbZ7Zdvk34
We’re launching HOF's Scout Program
As the industry grows, so does the need for Web 3 creative assets.
HOF offers design-as-a-service for Web 3 Projects.
We’re grateful for our recent collab with top projects like YGG (via @YGGEvents ) and @InsilicoTrading.
And we're eager to connect with more crypto founders and teams who are actively building in this market.
We’re launching HOF's Scout Program wherein you can expand your network in the crypto community, create opportunities, support our growth, and earn rewards.
You’re not just making HOF grow, you’re helping crypto get bigger too.
We're rewarding early core contributors for key introductions. We currently have 3 BD contributors from Nascent, Outlier ventures, and GCR.
What's the benefit for you?
Recommend promising crypto projects to benefit from HOF's design services, and when your introduction leads to a successful referral, you'll earn 10% RECURRING commissions.
Monetize your network. No limits.