Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding interface for applications that use operator role and delay in… #157

Merged
merged 4 commits into from
Sep 9, 2024

Conversation

vzotova
Copy link
Contributor

@vzotova vzotova commented Nov 10, 2023

… authorization decrease.

Fixes #156

Main suggestion here is to use both interfaces for all apps: TBCv2, RandomBeacon, TACo.
Names for method inherit those from RandomBeacon and TBTCv2, except one additional method to register operator using additional role (please leave comment: remove or keep it).
That unification will help with tracking changes between TBTC and TACo contracts, simplify dashboard interaction with contracts and also help with contract pool developing in the future.

@vzotova vzotova self-assigned this Nov 10, 2023
Copy link

Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/6828081757 check.

Copy link

Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/6828164286 check.

theref
theref previously approved these changes Nov 13, 2023
contracts/staking/IApplicationWithOperator.sol Outdated Show resolved Hide resolved
contracts/staking/IApplicationWithOperator.sol Outdated Show resolved Hide resolved
// TODO consider that?
// /// @notice Used by additional role (owner for example) to set operator address that will
// /// operate a node for the specified staking provider.
// function registerOperator(address stakingProvider, address operator) external;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's your opinion on this @vzotova @lukasz-zimnoch ? My suggestion would be to not include it in the interface, so it can be optionally implemented by applications that allow owners to set operators.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'm good with both options

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's your opinion on this @vzotova @lukasz-zimnoch ? My suggestion would be to not include it in the interface, so it can be optionally implemented by applications that allow owners to set operators.

Agreed! That feels optional and should not live on the interface level.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Then we need to remove it here as well? https://github.com/threshold-network/token-dashboard/blob/bbdc89047f2f32905cf35ccbb07ac414dc9b0ab2/src/threshold-ts/applications/index.ts#L191

We should probably be using the solidity-contracts repo in the dashboard rather than having a bunch of interfaces hard coded there

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ok, removed
@theref there is "regular" registerOperator in your link and this method still in interface

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

oh yes sorry, hadn't noticed the difference in signature.

ok, well the dashboard is using an interface to specify how application contracts should behave. If we don't include the version that allows applications to set Operators then it's not going to be available on the dashboard (unless we completely change the dashboard architecture)

external
view
returns (
uint96 _minimumAuthorization,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the _ here? Same for _stakingProvider in L51.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

otherwise it shadows function minimumAuthorization

contracts/staking/IApplicationWithDecreaseDelay.sol Outdated Show resolved Hide resolved
contracts/staking/IApplicationWithDecreaseDelay.sol Outdated Show resolved Hide resolved
Copy link

Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/6864825267 check.

Copy link

Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/6864969050 check.

Copy link

Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/6895222325 check.

Copy link

Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/6931805960 check.

Copy link

Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/6931814522 check.

Copy link

Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/6931841466 check.

Copy link

Solidity API documentation preview available in the artifacts of the https://github.com/threshold-network/solidity-contracts/actions/runs/6931919073 check.

Copy link
Member

@manumonti manumonti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! 👌

@cygnusv cygnusv merged commit 0c74099 into main Sep 9, 2024
11 checks passed
@cygnusv cygnusv deleted the app-interfaces branch September 9, 2024 16:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Extend IApplication to generalize tBTC, RandomBeacon and TACo apps
6 participants