Skip to content

vignatov/challenge

Repository files navigation

Tech interview smart contracts coding problem

This is a Solidity coding problem for tech interviews. It is designed to take no more than a few hours.

Getting setup

Ensure you have installed:

Instructions

1. Setup

Clone the repo locally and install the NPM dependencies using npm:

2. Task

You only need to write code in the Token.sol file. Please ensure all the unit tests pass to successfully complete this part.

The contracts consist of a mintable ERC-20 Token (which is similar to a Wrapped ETH token). Callers mint tokens by depositing ETH. They can then burn their token balance to get the equivalent amount of deposited ETH back.

In addition, token holders can receive dividend payments in ETH in proportion to their token balance relative to the total supply. Dividends are assigned by looping through the list of holders.

Dividend payments are assigned to token holders' addresses. This means that even if a token holder were to send their tokens to somebody else later on or burn their tokens, they would still be entitled to the dividends they accrued whilst they were holding the tokens.

You will thus need to efficiently keep track of individual token holder addresses in order to assign dividend payouts to holders with minimal gas cost.

For a clearer understanding of how the code is supposed to work please refer to the tests in the test folder.

Your Solution must pass the test: npm run test - run the tests (Hardhat)

Test Result

3: Submission

Record a short Loom video showing how it works, including the expected and actual behavior if you're testing.

4. Deadline

Please complete and submit the result within 1 ~ 2 hours unless otherwise discussed.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors