Contracts with missing implementation details and unit tests to help guide junior solidity developers.

Overview

template-challenge-staking

Contracts with missing implementation details and unit tests to help guide junior solidity developers.

Getting started

  1. Open the terminal at the root directory.
  2. Run the following command: npm i.
  3. Wait for the packages to install.
  4. Run the following command: npm test.
  5. The entire test suite should run, many of the tests should fail.

Project

The contracts can be found within the "contracts" folder. The tests can be found within the "test" folder.

The contracts used within the tests can be found within the "contracts/test" folder. These can be safely ignored.

Help

Hello dear developer, thank you for giving this challenge a go. My advice to you would be to first understand the hierarchy of the contracts. Once you do, make your way from the bottom up and read the tests for each contract. when you understand the requirements dictated by the tests, open the associated solidity contract and fill in the implementation detail until all of the tests pass. Lastly, move up the heirachy to the next contract and repeat until the entire suite passes.

If you get stuck, feel free to message me @BuiltByFrancis on twitter. I will be happy to help.

OpenZeppelin

I have chosen to use OpenZeppelin as it is one of the most common libraries and you are sure to come across it in your development journey. Feel free to use any of the contracts provided by the library in order to satisfy the implementation details.

Disclaimer

The tests are written with the assumption that the structure of the code within the contracts folder remains untouched. There is no guarentee that the test suite will function as expected should function signatures or contract inheritance hierarchies be changed. Do so only if you know what you are doing.

Improvements / Extensions

General (Easy):

  • I have explicitly removed all code comments for this challenge, so:
    • add contract level comments
    • add function level comments
    • add implementation detail comments where applicable. (Dont over do it)

StakedNFT (Medium):

  • I have ommited the code required to return a URI containing meta data for this contract.
    • Add the code
    • Test the code

TokenEmitter (Hard):

  • In a large collection setting up the "tokenRewardRateIndex" mapping would cost a huge amount of gas. Find an alternative method such as a merkle tree.
    • Note: The use of a merkle tree will require the changing of several function signatures. Fix the tests alongside development.
You might also like...

The Guard helps developers shield the details of the underlying authentication and tedious UI development

The Guard helps developers shield the details of the underlying authentication and tedious UI development

The Guard helps developers shield the details of the underlying authentication and tedious UI development. It enables enterprises and developers to quickly launch a secure, customizable UI unified login form.

Dec 19, 2022

🐢🦕 The missing child of Node.js and Deno.

🐢🦕 The missing child of Node.js and Deno.

Venode The missing child of Node.js and Deno. Venode is a node runner that supports deno features like vendoring and http imports! Features Javascript

Aug 18, 2022

Domvas implements the missing piece that connects the DOM and Canvas.

Domvas Overview Domvas implements the missing piece that connects the DOM and Canvas. It gives to the ability to take arbitrary DOM content and paint

Dec 29, 2022

e-ONG, an authorial project, whose objective is to help ONGs to find people who need help or would like to help them

This project was bootstrapped with Create React App. Available Scripts In the project directory, you can run: npm start Runs the app in the developmen

Nov 11, 2022

Missing Person Finder re-design

Missing Person Finder re-design

Missing Person Finder With ReactJs #Technology Used React Routing with React-routing-dom Redux with Redux Persist API calling with axios Ant design UI

Jul 12, 2022

The missing CLI for beautiful, interactive API docs powered by with Stoplight Elements

Elements CLI The missing CLI for beautiful, interactive API docs powered by with Stoplight Elements Installation Install using npm as global package:

Nov 22, 2022

🚀 NFTank (NFT tank for dummies) will allow developers to quickly request NFTs to personal wallets or smart contracts in just a few clicks.

🚀 NFTank (NFT tank for dummies) will allow developers to quickly request NFTs to personal wallets or smart contracts in just a few clicks.

👷‍♂️ NFTank 🚀 NFTank (NFT tank for dummies) will allow developers to quickly request NFTs to personal wallets or smart contracts in just a few click

Nov 8, 2022

Basic Implementation of a Contract Wallet in Solidity. The owner can transfer Ether/ERC20 and execute transactions via low-level calls.

Contract Wallet Basic Implementation of a Contract Wallet in Solidity. The owner can transfer Ether/ERC20 and execute transactions via low-level calls

Jun 18, 2022
Owner
BuiltByFrancis
.NET Software Engineer | Unity | React Student | Crypto Degen | Serial Learner | Productive Procrastinator
BuiltByFrancis
Notes, challenge resolutions, and applications of the Grokking Algorithms book content with unit tests

Grokking Algorithms Statements Branches Functions Lines Notes, challenge resolutions, and applications of the Grokking Algorithms book content Index F

Lucas Souza 5 Aug 14, 2022
SAP Community Code Challenge: This repository contains an empty OpenUI5 application and end-to-end tests written with wdi5. Take part in the challenge and develop an app that passes the tests.

SAP Community Code Challenge - UI5 The change log describes notable changes in this package. Description This repository is the starting point for the

SAP Samples 8 Oct 24, 2022
A robust and light-weight inventory management application designed to help businesses maintain perfect control over every unit of stock.

Inventory Buddy Access inventory anytime on web, tablet or mobile. Inventory Buddy is a robust and light-weight inventory management application desig

Brynn Smith 7 Nov 5, 2022
A hardhat solidity template with necessary libraries that support to develop, compile, test, deploy, upgrade, verify solidity smart contract

solidity-hardhat-template A solidity hardhat template with necessary libraries that support to develop, compile, test, deploy, upgrade, verify solidit

ChimGoKien 4 Oct 16, 2022
A professional truffle solidity template with all necessary libraries that support developer to develop, debug, test, deploy solidity smart contract

solidity-truffle-template A professional truffle solidity template with necessary libraries that support to develop, compile, test, deploy, upgrade, v

ChimGoKien 6 Nov 4, 2022
Boilerplate starter template for a new TON blockchain project - FunC contracts, JS tests, compilation and deployment scripts

TON Starter Template - Contracts Starter template for a new TON project - FunC contracts, JS tests, compilation and deployment scripts Overview This p

TON DeFi Ecosystem 44 Dec 17, 2022
timecapsule solidity contracts + app

timecapsule-contracts compile contracts: $ yarn compile run tests: $ yarn test deployed and verified on testnets: - rinkeby: https://rinkeby.ether

null 2 Sep 25, 2021
A MERN Stack dapp the utilizes three solidity contracts

A MERN Stack dapp the utilizes three solidity contracts. It verifies user ownership of third party NFTs, generates an image incorporating a third party NFT image pulled from IPFS, mints a new NFT for users that includes an on-chain message and metadata to Opensea standards.

Max Girteit 5 Jun 30, 2022
Using a Decentralized Application (DApp) to Sell artwork on the Ethereum blockchain with smart contracts written in Solidity.

Decentralized Applications For Selling Limited Time Artwork This repository houses the Solidity, JavaScript, and HTML code for a Decentralized Applica

Keyan Ahmadi 4 Mar 20, 2023