No funded issue found.
Check out the Issue Explorer
Be the OSS Funding you wish to see in the world.
Looking to fund some work? You can submit a new Funded Issue here .
Time left
Opened
Issue Type
Workers Auto Approve
Project Type
Time Commitment
Experience Level
Permissions
Accepted
Reserved For
Calldata with predicates
gnosis
Gnosis
**Background**
The Gnosis MockContract is a smart contract enabling developers to quickly mock contract interactions for unit tests.
It enables developers to
- Make dependent contracts return predefined values for different methods and arguments
- Simulate exceptions such as revert and outOfGas
- Assert on how often a dependency is called
The MockContract facilitates these features without requiring any separate test contracts. Check out the repo: https://github.com/gnosis/mock-contract
**Task**
Extend the functionality of the MockContract to mock contract interaction on calldata with predicate
s
_Acceptance criteria:_
- Develop a framework allowing developers to define predicates on calldata for specific methods.
The predicates should include GREATER_THAN with a definition similar to:
```python
const calldata = contract.methods.foo(
GREATER_THAN(10)
).encodeABI()
```
and the predicate SMALL_THAN
```python
const calldata = contract.methods.foo(
SMALLER_THAN(10)
).encodeABI()
```
- Write the logic for the MockContract to expose predefined returns to calldata with predicates.
Hence, it is expected that the following functions are provided for calldata with predicates:
```python
function givenPredicateCalldataReturn(bytes calldata call, bytes calldata response) external;
function givenPredicateCalldataReturnBool(bytes calldata call, bool response) external;
function givenPredicateCalldataReturnUint(bytes calldata call, uint response) external;
function givenPredicateCalldataReturnAddress(bytes calldata call, address response) external;
function givenPredicateCalldataRevert(bytes calldata call) external;
function givenPredicateCalldataRevertWithMessage(bytes calldata call, string calldata message) external;
function givenPredicateCalldataRunOutOfGas(bytes calldata call) external;
```
They should enable the same functionality on calldata with predicates as the current respective
functions with the same function names, but without the word "Predicate".
- Make sure the invocation count functions are still returning the right numbers
:
```python
function invocationCount() external returns (uint);
function invocationCountForMethod(bytes calldata method) external returns (uint);
function invocationCountForCalldata(bytes calldata call) external returns (uint);
```
- Current naming conventions need to be preserved
- All functionality must have 100 % line and branch coverage
- The [solidity style guide](https://solidity.readthedocs.io/en/v0.5.3/style-guide.html) must be considered and code must be linted
**Payout:**
0.75 ETH
Additional GNO can be tipped according to the level of technical implementation
Setup your profile
Tell us a little about you:
Skills
No results found for [[search]] .
Type to search skills..
Bio Required
[[totalcharacter]] / 240
Are you currently looking for work?
[[ option.string ]]
Next
Setup your profile
Our tools are based on the principles of earn (💰), learn (📖), and meet (💬).
Select the ones you are interested in. You can change it later in your settings.
I'm also an organization manager looking for a great community.
Back
Next
Save
Enable your organization profile
Gitcoin products can help grow community around your brand. Create your tribe, events, and incentivize your community with bounties. Announce new and upcoming events using townsquare. Find top-quality hackers and fund them to work with you on a grant.
These are the organizations you own. If you don't see your organization here please be sure that information is public on your GitHub profile. Gitcoin will sync this information for you.
Select the products you are interested in:
Out of the box you will receive Tribes Lite for your organization. Please provide us with a contact email:
Email
Back
Save