Skip to content

Conversation

@Diogomartf
Copy link
Contributor

@Diogomartf Diogomartf commented Dec 17, 2024

Description

  • update initialised event to use more data so we can get it on subgraph
  • Fixes to make test work: update env vars and new ones, improve names, remove whitelist test (not needed).
  • optimize Storage and calculations in slotSellAmount(), you're using SafeMath's tryDiv() With Solidity 0.8.x, you can use standard division, which is more gas-efficient.
  • Optimize orderSlots(): We can make this function more gas efficient by pre-calculating values and reducing operations
  • Optimize slotSellAmount(): Cache storage reads and simplify logic
  • update solidity version 0.8.28

Test are green ✅

image

run locally with

forge test

@vercel
Copy link

vercel bot commented Dec 17, 2024

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
stackly-app ❌ Failed (Inspect) Dec 17, 2024 0:11am
stackly-app-npkw ❌ Failed (Inspect) Dec 17, 2024 0:11am

… by pre-calculating values and reducing operations

- Optimize slotSellAmount(): Cache storage reads and simplify logic
@Diogomartf
Copy link
Contributor Author

Diogomartf commented Dec 17, 2024

This PR was an exploration of improvements to do to to our contracts to be more efficient and also help improve the subgraph by emmiting events with more data reducing eth_calls.

But this update would require us to update all the contracts so it's all uniformed.

@Diogomartf Diogomartf closed this Dec 17, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants