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

Create PredictoorHelper and add submitTruevals function #800

Conversation

trizin
Copy link
Contributor

@trizin trizin commented Aug 24, 2023

Fixes #799

Changes proposed in this PR:

  • Create PredictoorHelper contract
  • Add submitTruevalContracts and submitTruevals functions to PredictoorHelper contract
  • Add function tests

@trizin trizin linked an issue Aug 24, 2023 that may be closed by this pull request
@trizin trizin changed the base branch from main to issue797-remove-floatvalue-from-predictoor-contract August 24, 2023 10:11
contracts/utils/PredictoorProxy.sol Fixed Show fixed Hide fixed
contracts/utils/PredictoorProxy.sol Fixed Show fixed Hide fixed
contracts/utils/PredictoorProxy.sol Fixed Show fixed Hide fixed
contracts/utils/PredictoorProxy.sol Fixed Show fixed Hide fixed
contracts/utils/PredictoorProxy.sol Fixed Show fixed Hide fixed
contracts/utils/PredictoorProxy.sol Fixed Show fixed Hide fixed
contracts/utils/PredictoorHelper.sol Fixed Show fixed Hide fixed
contracts/utils/PredictoorHelper.sol Dismissed Show dismissed Hide dismissed
contracts/utils/PredictoorHelper.sol Dismissed Show dismissed Hide dismissed
contracts/utils/PredictoorHelper.sol Dismissed Show dismissed Hide dismissed
contracts/utils/PredictoorHelper.sol Dismissed Show dismissed Hide dismissed
contracts/utils/PredictoorHelper.sol Dismissed Show dismissed Hide dismissed
contracts/utils/PredictoorHelper.sol Dismissed Show dismissed Hide dismissed
}

function submitTruevals(
address contract_addr,

Check warning

Code scanning / Slither

Conformance to Solidity naming conventions Warning

contracts/utils/PredictoorHelper.sol Fixed Show fixed Hide fixed
@trizin trizin changed the title Add submitTrueValMultiple function into DT3 template Create PredictoorHelper and add submitTruevals function Aug 28, 2023
@trizin trizin marked this pull request as ready for review August 28, 2023 13:19
@alexcos20
Copy link
Member

can you also add it to deploy-contracts script please?
We are going to need that deployed contract address

contracts/utils/PredictoorHelper.sol Show resolved Hide resolved
function submitTruevalContracts(
address[] calldata contract_addrs,
uint256[][] calldata epoch_starts,
bool[][] calldata trueVals,
Copy link
Member

Choose a reason for hiding this comment

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

why do we have double [] ?
It should be one-dimensional array

Copy link
Contributor Author

Choose a reason for hiding this comment

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

An array of arguments for each contract address

@alexcos20
Copy link
Member

can we keep it simple, with one-dimensional arrays ?

Co-authored-by: Alex Coseru <alex.coseru@gmail.com>
}

contract PredictoorHelper {
address admin;

Check warning

Code scanning / Slither

State variables that could be declared immutable Warning

PredictoorHelper.admin should be immutable
@trizin
Copy link
Contributor Author

trizin commented Aug 28, 2023

can we keep it simple, with one-dimensional arrays ?

To clarify, there are two functions:

submitTruevals function submits multiple truevals for one contract. (one dimensional)

submitTruevalContracts function submits truevals for multiple contracts. (two dimensional - one per each contract)

Both are external functions.

@trizin trizin requested a review from alexcos20 August 28, 2023 14:28
scripts/deploy-contracts.js Outdated Show resolved Hide resolved
Co-authored-by: Alex Coseru <alex.coseru@gmail.com>
@trizin trizin merged commit 025280e into issue797-remove-floatvalue-from-predictoor-contract Aug 29, 2023
8 checks passed
@trizin trizin deleted the 799-add-batchsubmittrueval-function-into-dt3-template branch August 29, 2023 08:32
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.

Add batchSubmitTrueval function into DT3 template
2 participants