The ConsenSys Blockchain Developer Bootcamp 2021 is ConsenSys Academy's flagship technical program. The course covers blockchain fundamentals, smart contracts (Solidity), developer tooling, and second order effects. The final project is to deploy a dApp with a set of smart contracts, tests, and a web interface.
This dApp will utilize Set Protocol V2 to create a smart contract managed Social Trading Set. The Manager will call the Trade Module to execute atomic trades and change the underlying collateral in a Set for all token holders. The Streaming Fee Module accrues streaming fees for the Manager.
In future work, this dApp is looking to add an Algorithmic Trading Set. In this system a Strategy Adapter instructs the Manager on how to call the Trade Module when triggered by a Keeper Bot.
contracts
:manager/SocialTradingManager.sol
is the main contract, which acts as the smart contract manager for the PBSocial token.interfaces/ITradeModule.sol
is also custom. The rest of the contracts come from Set Protocol.diagrams
: Contract architecture diagrams used in the README.mdfrontend
: Holdsdapp.js
which is the JavaScript for the front end.index.html
lies outside this folder for Github Pages to recognize.migrations
: deployment scripts for truffletest
: A handful of tests for theSocialTradingManager
contract
blockchain-developer-bootcamp-final-project
├── contracts
│ ├── interfaces
│ ├── ├── IExchangeAdapter.sol
│ ├── ├── ISetToken.sol
│ ├── ├── IStreamingFeeModule.sol
│ ├── ├── ITradeModule.sol
│ ├── lib
│ ├── ├── MutualUpgrade.sol
│ ├── ├── PreciseUnitMath.sol
│ ├── manager
│ ├── ├── SocialTradingManager.sol
│ ├── Migrations.sol
├── diagrams
│ ├── algorithmicTradingArchitecture.jpg
│ ├── socialTradingArchitecture.jpg
├── frontend
│ ├── dapp.js
├── migrations
│ ├── 1_initial_migration.js
│ ├── 2_social_trading_manager.js
├── test
│ ├── social_trading_manager.js
├── .gitignore
├── README.md
├── avoiding_common_attacks.md
├── deployed_address.txt
├── design_pattern_decisions.md
├── index.html
├── package-lock.json
├── package.json
├── truffle-config.js
The frontend interface is hosted on Github Pages at pblivin0x.github.io/blockchain-developer-bootcamp-final-project/
pblivin.eth (0xD20673d9c07BaA5400B9DF075C3077DfE75A1a1F
)
npm install @openzeppelin/contracts@3.1.0
npm install @truffle/hdwallet-provider
npm install dotenv
truffle test
- In the "Social Trader" tab of the frontend, create a Set Token, yielding a new
setTokenAddress
- Deploy the Social Trading Manager
truffle migrate --network kovan
with the newsetTokenAddress
in the constructor, yielding a newsocialTradingManagerAddress
- Initialize the
BasicIssuanceModule
- Initialize the
StreamingFeeModule
with thesocialTradingManagerAddress
as the fee recipient - Initialize the
TradeModule
- Update the Set Token Manager to
socialTradingManagerAddress