---
# System prepended metadata

title: Task1

---

useful links:
contract github https://github.com/blossomland/blossom-contracts-final-new
rmrk docs https://evm.rmrk.app/
EAS https://attest.sh/



### Task 1

Clone the https://github.com/andrejrakic/gas-golfing-challenge-looper repo. Your task is to lower the gas consumption of the Looper.sol smart contract from the current 43.606 gas to at least 30.000 gas, or lower. You must not edit the doStuff function. Bonus points if you can lower it to 24.655 or less.

### Task 2
NFT metadata is stored packed as bytes32 variable. It packed the owner's address into the least significant 20 bytes, the RGB colour into the next 3 bytes, the isTransferable boolean flag into the next byte, and the tokenId into the most significant 8 bytes.


| 8 bytes tokenId | 1 byte isTransferable | 3 bytes of colour 3 |   20 bytes of owner’s address  |
| --------------- | --------------------- | ------------------- | --- |
| uint64          | bool                  | uint24              |  address   |

Write a function in YUL to get the value of the colour.

For example, 0x0000000000000001018000ffd8da6bf26964af9d7eed9e03e53415d37aa96045 should return 8388863 or 0x8000FF, its hexadecimal representation.

### Task 3
Rmrk made a new release and update of their protocol. in this task, u should update rmrk dependency in our current contracts to the newest one and deploy and verify new contracts. also, pass all tests successfully and possibly add tests u think we didn't make

### Task 4

so we are exploring atm to transition to EAS, now that u know the structure of our protocol how would u:

1. Draw us how would u transition our current infra to use EAS instead of nfts. 

    (we expect just simple drawings like https://excalidraw.com/#room=666cf29bc1d5e32577a2,o-DPpXp9GWnVKOo3UseTww you can use literally anything for drawing, we just care about conceptual thinking)
    
2. The user wanna change the address that is profile owner.

    We want for user to be able to change the address that is the owner of the profile NFT (most probably via social recovery).

    with Rmrk that is easy, u just transfer the profile NFT to the new address. but in EAS we don't have NFTs and all attestations are tied to the address aka account bound that is either EOA or can be a smart contract. with that in mind, how would u implement profile ownership transferability with EAS (Again basic drawing with pseudocode is enough)
    
3. Issue reputation to a user that doesn't have the profile.

    atm our system works and use twitter UID as a unique source of truth. so here is an example:

    *Nemo wanna issue a reputation to Phenix*
    - system takes Phenix handle
    - ask twitter for uid
    - check if there is nft profile that's tied to that UID

    ***IF PROFILE EXISTS***
    - issue pending reputation

    ***IF PROFILE DOESNT EXISTS***

    - mint nft profile and tie it to twitter UID
    - transfer profile ownership to a smart contract (profile.sol)
    - issue pending reputation

    once Phenix actually comes to the platform, during the onboarding process when he auth with twitter, we will recognize twitter uid our system will instead of minting new nft profile just transfer ownership of nft to the newly authenticated phenix user.

    ***how would u implement this to work with EAS instead of RMRK?***