---
# System prepended metadata

title: Baal Ketchup (4/26/22)
tags: [baal, ' contracts']

---

---
tags: baal, contracts
---

# Baal Ketchup (4/26/22)

## Agenda

- Contract changes and cleanup
- Subgraph
- Code lock for audit
- Docs

## Contract Changes

- Changes made to clean things up on feature branch -- Bill will make a PR into Dekan's branch
    - Cleaning up `sponsorship` 
    - Removing `name` and `symbol` from storage
    - Events -- falling back to matching what we're going to grab from ERC20 Events
- Out of gas:
    - Get an estimation on the frontend and submit with the proposal and check in the execution whether the gas submitted to execute is >= what is submitted with the proposal
    - Gnosis checks at the *execution stage* and reverts there
        - Comes up with an estimate when calling the execute function
        - Not sure if we're able to replicate this flow: complex, but may also put us over the contract size limit (although this may be fine now)
        - This is the safest approach since it's being done when needed instead of being done prior to needing it
        - How would we estimate this?
    - If going through a proxy contract like the Tribute we'd be able to estimate
    - Run suggestion by Gnosis and get feedback
- Estimating gas:
    - How do we estimate gas on everything that's being executed?
    - Can we make a call with the execution data?
    - https://docs.gnosis-safe.io/contracts/guards/
        - Estimated on the frontend or manually added by users
    - Requirement that the gas would *exceed* the safe transaction amount so that the transaction can't be processed if it's lower
        - Frontend would need to estimate the gas for the entire multi-action transaction
        - Equivalent of the safe transaction gas in our model
        - If we increase this, user would get a refund for what's not used
        - State or conditions can change over time, so impossible to be completely accurate
            - Simulator would allow for us to get in the ballpark to prevent bad actors from processing a proposal with gas that's too low
            - Simulation * 10% or 20% and a `require` statement that user needs to submit *with at least* as much gas as this or it'll revert
            - Someone intent on being a bad actor could go directly to the contract on Etherscan and input gas as 1 gwei
        - Frontend allowing to add fields via the "+ More" button
            - Add field to manually change the Baal Transaction Gas
            - Tooltip that explains estimation and buffer process and reason why
        - Use ethers estimate and bump it up for the estimate
    - 0 is unlimited -- max gas needed 
        - Default to this? Would fix this issue, but could be less than ideal UX

## Audit

- Scribble is a TODO on the contract
- What would we need to do this?
- https://docs.scribble.codes/

## Docs

- Continue to round out the docs pages

## ToDo

- [ ] Submit PR to the [sharesToken](https://github.com/HausDAO/Baal/tree/feature/sharesToken) branch (@billw#2534)
- [ ] Get `dan13ram` the `warcamp-temp` role (@earth2travis#6969)
- [ ] Determine if `dan13ram` is interested in picking up the [Add Scribble Annotation](https://github.com/HausDAO/daohaus-monorepo/issues/24) issue (@earth2travis#6969)
- [ ] [Update Baal to check estimated gas on proposal execution](https://github.com/HausDAO/daohaus-monorepo/issues/90) (@dekanbro#7256)
- [ ] Handoff Quantstamp contact to Ξ2T (@billw#2534)
