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
Fix Bitmap offset bug
wearekickback
kickback
## Bounty
- 1 ETh to the first person who raises PR to fix the bug with a complete test.
## Issue summary
At Kickback, we send a list of participants who were checked in as a bitmap to save gas cost.
eg: when 300 people RSVPed and i1, i2, i256, i257, i298, i299 attended, we send bitmap of 2 bytes containing the following.
`finalise([110, 11000000000000000000000000000000000000000011])`
NOTE: Bitmap starts from right to left so 110 is 0, 1, 1
For more info, please refer to [our test](https://github.com/wearekickback/contracts/blob/master/test/behaviors/conferenceFinalize.behavior.js#L50).
At the last [EthLondon hackathon](https://kickback.events/event/0x741909cab7ab8efce27761237d3463fc779ca539), we had a dozen of reports from participants who could not withdraw despite marked as "checked in" because [their transactions](https://etherscan.io/tx/0xba5b98dbfaf8649de0597bc26ced743404bd03a737368e04e1971acdd151c6b3) got reverted with message 'Fail with error 'event still active or you did not attend''
After [our analysis](https://docs.google.com/spreadsheets/d/14xaRx6vP_VklsHeuQflv17lQS6paF0Qxey1G8-I0sIw/edit#gid=0), it turned out `isAttended(address)` that the logic to return whether the user has attended or not does not match by one row after 123rd participant.
The column C(bitmap) is derived from the bitmap info sent at finalisation at [etherscan](https://etherscan.io/tx/0x0f84a80131d1b2c840259445988d58d358c3f293a2ff04f78df6c906d99b255e#eventlog)
Input data
```
0xe17e082b0000000000000000000000000000000000000000000000000000000000000020000000000000000000000000000000000000000000000000000000000000000100000000000f7fdffffdadbfaffefffb57ff87dbddd2f797ef7dfbfcfceff4df
```
Hex `f7fdffffdadbfaffefffb57ff87dbddd2f797ef7dfbfcfceff4df` => Bin `11110111111111011111111111111111110110101101101111111010111111111110111111111111101101010111111111111000011111011011110111011101001011110111100101111110111101111101111110111111110011111100111011111111010011011111` then you reverse the order.
The column D(`isAttended`) is derived by calling the function for each address
```
function isAttended(address _addr) public view returns (bool){
if (!isRegistered(_addr) || !ended) {
return false;
}
// check the attendance maps
else {
Participant storage p = participants[_addr];
uint256 pIndex = p.index - 1;
uint256 map = attendanceMaps[uint256(pIndex / 256)];
return (0 < (map & (2 ** (pIndex % 256))));
}
}
```
## Submission criteria
We suspect that the bug is either in [our smart contract](https://github.com/wearekickback/contracts) or [js library](https://github.com/wearekickback/shared/blob/master/src/participants.js) to encode/decode the bitmap.
- Write a failing test to replicate the error.
- Write a fix to make the test pass.
- Make sure that other tests do not fail.
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