-
Notifications
You must be signed in to change notification settings - Fork 8
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
[PDB-01M] Arbitrary External Contract Calls #894
Conversation
contracts/protocol/clients/priceDiscovery/BosonPriceDiscovery.sol
Dismissed
Show dismissed
Hide dismissed
contracts/protocol/clients/priceDiscovery/BosonPriceDiscovery.sol
Dismissed
Show dismissed
Hide dismissed
contracts/protocol/clients/priceDiscovery/BosonPriceDiscovery.sol
Dismissed
Show dismissed
Hide dismissed
contracts/protocol/clients/priceDiscovery/BosonPriceDiscovery.sol
Dismissed
Show dismissed
Hide dismissed
contracts/protocol/clients/priceDiscovery/BosonPriceDiscovery.sol
Dismissed
Show dismissed
Hide dismissed
import { Address } from "@openzeppelin/contracts/utils/Address.sol"; | ||
import { SafeERC20 } from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; | ||
|
||
// import { BosonPriceDiscovery } from "./../clients/priceDiscovery/BosonPriceDiscovery.sol"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
remove unused code
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Removed
/** | ||
* @title BosonPriceDiscovery | ||
* | ||
* @dev Boson Price Discovery is a external contract that is used to determine the price of an exchange. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* @dev Boson Price Discovery is a external contract that is used to determine the price of an exchange. | |
* @dev Boson Price Discovery is an external contract that is used to determine the price of an exchange. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
|
||
/** | ||
* @notice | ||
* For offers with native exchange token, it is expected the the price discovery contracts will |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* For offers with native exchange token, it is expected the the price discovery contracts will | |
* For offers with native exchange token, it is expected that the price discovery contracts will |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed.
/** | ||
* @notice | ||
* For offers with native exchange token, it is expected the the price discovery contracts will | ||
* operate with wrapped native token. Set the address of the wrapped native token in the constructor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
* operate with wrapped native token. Set the address of the wrapped native token in the constructor. | |
* operate with wrapped native token. Sets the address of the wrapped native token in the constructor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I kept that as it was, since it's meant as an instruction for the deployer.
Fix #861
This change moves a part of price discovery logic outside the diamond, effectively creating another boson protocol client.
Since this client does not own any assets, they cannot be stolen from it. The user will always approve only Boson Protocol or external price discovery contract to transfer the vouchers and/or erc20 tokens.
Users can still make arbitrary calls through this client, but since it's outside the boson protocol address, any calls that the client makes will not be directly associated with the boson protocol.