Skip to content

Dashboard listens for wrong AuthorizationIncrease events #626

Open
@cygnusv

Description

@cygnusv

The consensus we had with @pdyraga and @vzotova was that, for authorization purposes, we'd look for events only in the Staking contract, since applications may have different internal semantics. See threshold-network/solidity-contracts#88 (comment)

However, during the work for #603, we've detected that the dashboard listens for events on the application:

const contract = useStakingAppContract(appName)
const dispatch = useAppDispatch()
useSubscribeToContractEvent(
contract,
"AuthorizationIncreased",
// @ts-ignore
async (stakingProvider, operator, fromAmount, toAmount) => {
dispatch(
stakingApplicationsSlice.actions.authorizationIncreased({
stakingProvider,
toAmount: toAmount.toString(),
appName,
})
)
}

Coincidentally, tBTC and RB app contracts define AuthorizationIncreased events with the exact signature than those from the staking contract, so for their particular case, listening for app events work. However, this is problematic for the TACo app contract that doesn't define them in the same way (which shouldn't be a problem)

The solution would be to listen for these events in the staking contract, as originally intended.

### Tasks
- [ ] https://github.com/threshold-network/token-dashboard/pull/636

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions