Try โ€‚โ€‰HackMD

Retriev/Web3Storage - batch change proposal

๐ŸŒ Context

We are working on the Batch operator smart contract and we found a blocker since to make createDealProposal work we need to add another parameter owner to define who is requesting the deal proposal.

๐Ÿ’ฃ Problem

We want to be sure that no-one can create deal proposals on behalf to other users because we want to prevent any kind of spam.

๐Ÿ“Œ Proposal Overview

  • We have to add the parameter owner to createDealProposal so it will be function createDealProposal(address owner, string memory _data_uri, uint256 duration, uint256 collateral, address[] memory _providers, address[] memory _appeal_addresses)
  • We have to add another state variable which will be called bulkContract which will contain the address of the allowed contract
  • Mentioned variable bulkContract will be managed by the "Protocol Managers" so it can be changed over time
  • We have to add another additional check in createDealProposal function because we want to be sure it works in this way:
    • if msg.sender == owner it's all fine, because we know that sender (the address who sent the transaction) is the same of provided owner.
    • if msg.sender != owner means we have to do another check:
      • if msg.sender == bulkContractAddress the transaction is valid, because it arrives from a trusted source, the transaction will be accepted
      • if msg.sender != bulkContract the transaction is you not valid, bcause it arrives from an untrusted source, the transaction will fail