Skip to content

mortelli/blockchain-technical-test

Repository files navigation

Blockchain Technical Test

This repo contains answers for a Blockchain Technical Test challenge, as well as the code for the practical excercise (question J).

Answers for each individual question can be found in the answers directory.

Practical excercise documentation

Solidity code for the solution can be found in the contracts directory.

Typescript test code for the solution can be found in the test directory.

Usage

Standard Hardhat commands are available.

For the full list of commands please check the package.json file.

Installation

npm i

Tests

npm run test

Test coverage

npm run coverage

Development notes

Here's a list of additional restrictions imposed as well as liberties taken for developing the CampaignSale contract:

  1. the maximum length for a campaign is exposed as a public constant so users can query it in case a campaign launch reverts with a campaign length exceeds maximum error
  2. a campaign cannot be launched with a goal of 0 tokens
  3. a specific campaign does not exist error was added to the cancel, contribute to, withdraw from, claim, refund and get campaign functionalities
  4. campaigns are deleted in order to follow the instructions; it would have been preferrable to disable them instead (see here for reasons why)
  5. a campaign cannot be contributed to or withdrawn from using an amount of 0 tokens
  6. even after a campaign is refunded, the pledged field will still record the amount deposited for historical purposes

About

Blockchain Technical Test

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published