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