Bug
Several events emitted by the Astera contracts omit the caller's address from the event data. For example, the pool's `deposit` event includes the amount and token but not the depositor address. Off-chain audit logs and indexers cannot attribute on-chain actions to specific addresses without this information.
Events Missing Caller Address
- `pool::deposit` — missing depositor address
- `pool::withdrawal` — missing withdrawer address
- `invoice::funded` — missing funder (lender) address
- `invoice::repaid` — missing repayer address
- `credit::score_updated` — missing trigger address (who caused the update)
Fix
Include the caller address in all action events:
```rust
pub fn deposit(env: Env, token: Address, amount: i128) {
let depositor = env.invoker();
// ... deposit logic ...
env.events().publish(
(Symbol::new(&env, "pool"), Symbol::new(&env, "deposit")),
(depositor, token, amount, shares_minted, env.ledger().timestamp()),
);
}
```
Acceptance Criteria
References
- `contracts/pool/src/lib.rs` — deposit, withdrawal events
- `contracts/invoice/src/lib.rs` — funded, repaid events
- `contracts/credit_score/src/lib.rs` — score_updated event
Bug
Several events emitted by the Astera contracts omit the caller's address from the event data. For example, the pool's `deposit` event includes the amount and token but not the depositor address. Off-chain audit logs and indexers cannot attribute on-chain actions to specific addresses without this information.
Events Missing Caller Address
Fix
Include the caller address in all action events:
```rust
pub fn deposit(env: Env, token: Address, amount: i128) {
let depositor = env.invoker();
// ... deposit logic ...
env.events().publish(
(Symbol::new(&env, "pool"), Symbol::new(&env, "deposit")),
(depositor, token, amount, shares_minted, env.ledger().timestamp()),
);
}
```
Acceptance Criteria
References