Generates 1 interaction executing the given hooks via the trampoline contract since executing hooks directly from the settlement contract context would give them elevated privileges that put funds at risk.
(&self, hooks: &[app_data::Hook])
| 263 | /// contract since executing hooks directly from the settlement contract |
| 264 | /// context would give them elevated privileges that put funds at risk. |
| 265 | fn encode_hooks(&self, hooks: &[app_data::Hook]) -> Option<InteractionData> { |
| 266 | if hooks.is_empty() { |
| 267 | return None; |
| 268 | } |
| 269 | Some(InteractionData { |
| 270 | target: self.simulator.0.hooks_trampoline, |
| 271 | value: U256::ZERO, |
| 272 | call_data: contracts::HooksTrampoline::HooksTrampoline::executeCall { |
| 273 | hooks: hooks |
| 274 | .iter() |
| 275 | .map(|h| contracts::HooksTrampoline::HooksTrampoline::Hook { |
| 276 | target: h.target, |
| 277 | callData: Bytes::copy_from_slice(&h.call_data), |
| 278 | gasLimit: U256::from(h.gas_limit), |
| 279 | }) |
| 280 | .collect(), |
| 281 | } |
| 282 | .abi_encode(), |
| 283 | }) |
| 284 | } |
| 285 | |
| 286 | /// Instructs the builder to override the settlement contract's buy-token |
| 287 | /// balances so it can pay out every order. The exact amounts are derived |
no test coverage detected