dev-contracts-spcoin v1.0.0
spcoin-hardhat-contracts-ts-access
Directory of Information
Find your way using the directory below:
- Legal Disclaimer & Copyright Agreement ©
- Repository
- About
- Installation
- Environment Setup
- Command Menu Shortcuts
- Running Your First Test through the Menu
- Hardhat localhost Server Setup
- Remix Website IDE Setup
- Package Contents
- Running the Package
- Video Tutorial
- About the Author
Name Key Contact Robert Lanson sponsorcoin@yahoo.com
Copyright Agreement
Package spcoin-hardhat-contracts-ts-access ©
Read all copyright clauses and information before continuing to download and/or interact with this software. All interaction and use of such software hereon forward assumes complete agreement to all copyright terms and general conditions as specified.
- This program is permissible for re-distribution provided this copyright/license header is present in any redistribution of this package, in partial or entirely.
- There exists no warranty or guaranty of any kind in any way and is not assured to be as required and may not work exactly as designed for all operating systems employing various potentially conflicting software programs and entities.
- It is recommended to read the contents of the scripts to be assured of the process and what will be installed.
- The user is free to modify the code as required.
- There may not be any associated uninstall script. Uninstalling any such software or its effects on any system is the system owners responsibility.
- It is recommended to be installed on a test system in a test environment before promoting to a production environment.
- There is absolutely no guarantee of profit in any way, implying there should not be any expectation of financial gain while utilizing this application and associated development kit.
**INSTALL AT YOUR OWN RISK: END OF DISCLAIMER
Repository Information
About
- Version: 1.0.0
- Release Date: Dec 1st. 2024
- Purpose: spcoin-hardhat-contracts-ts-access is a WIP GUI front end package to demonstrate blockchain connectivity and transactions.
- Description: spcoin-hardhat-contracts-ts-access package is a front end GUI package mimicking Uniswap's appearance and utilizing Uniswap’s SDK to perform price matching and trade transactions.
Installation
- Please Note: For a comprehensive demonstration of the installation process, refer to the 'Video Tutorial' section below.
- In your installation directory, clone your local computer, the package: spcoin-hardhat-contracts-ts-access ©
- Change your current directory to /spcoin-hardhat-contracts-ts-access
- Install the required node packages, npm -install
- Next install the text menu driven system as follows:
- execute the following command: '. ./scripts/setupEnvAlises.sh'
- Notes:
- This installation assumes operation under command window bash or gitBash for windows
- The Menu System modifies the ~/.bashrc file to add an environment path link
Environment Setup
- Now we will setup the menu alises for testing the sponsor coin project through hardhat.
- From a linux command windrow, run the menu script . ./scripts/setupEnvAlises.sh from the projects home directory spcoin-hardhat-contracts-ts-access.
- Typing m will display a list of menu shortcut alias commands.
- A sample configuration file ".env" exists in project's home directory /spcoin-hardhat-contracts-ts-access/.e/SAMPLE.env.
- Create an account on "ALCHEMY". And get your free ALCHEMY Network access keys.
- Create an account on "INFURA". And get your free INFURA Network access keys.
- Copy the sample file /spcoin-hardhat-contracts-ts-access/.e/SAMPLE.env to /spcoin-hardhat-contracts-ts-access/.env.
- This file, ".env" requires your keys from above to be added for block chain network access.
- Further environment settings exist in the file /spcoin-hardhat-contracts-ts-access/env/.e.
Command Menu Shortcuts
The All Command Menus are a list of shortcut alias commands for administering the 'spcoin-hardhat-contracts-ts-access' project.
- If the menu system is installed correctly, simply type short cut alias 'm \' in a bash window and the following should appear:
The Main Menu
The above menu is simply a menu of many submenus. Each entry is an alias to an alternate command menu short cut. Each submenu exists under the repositories’ spcoin-hardhat-contracts-ts-access/env directory. These menus cane be more completely described in the file ./setupEnv/ReadMe.md.
Running Your First Test Through the Menu
- Menu test example, running run alias command "hhtest which is defined as alias hhtest='sethh; reset;clear; npx hardhat test 2>&1 | tee ./test.out/hhtest.out'"
- Type hhtest
- This command starts a hardhat server, deploys spCoin on the server, runs a test and dumps the output to directory file "sponsorCoinAdmin/spcoin-hardhat-contracts-ts-access/test.out/hhtest.out"
Hardhat localhost Server Setup
- HardHat is a network access server for implementing and testing contracts using Javascript Node.
- It is recommended to use a linux based command window such as bash or git bash.
- Videos are available as a tutorial starter on this site. YET TO COME???.
- Open up a bash window and start the server with the command npx hardhat node
Remix Website IDE Setup
- Remix is a browser based Solidity contract ide required to edit test and/or deploy contracts to a specified network.
- In the browser of your choice, enter the URL https://remix.ethereum.org/
- Videos are available as a tutorial starter on this site.
- Change directory to the project directory spcoin-hardhat-contracts-ts-access and start the source workspace server by typing remixd
- In the Remix page on the browser select File Explorer and open Local File System the directory should be loaded.
- Start the HardHAt server with the command npx hardhat node & which should start up ad hardhat server endpoint at http://127.0.0.1:8545.
Package Contents
- README.md ~ The Readme Documentation is this documentation.
- ./scripts/spCoinSetup.sh ~ This file is to be run from the scripts directory and downloads the spcoin-hardhat-contracts-ts-access repository to local. Next it executes the spCoinEnvSetup.sh file for environment setup.
- ./setupEnv/ ~ This directory is a mounted submodule containing files for environment and menu execution commands. refer to the ./setupEnv/ReadMe.md for a more complete Overview.
- ./setupEnv/spCoinEnvSetup.sh ~ This shell creates the environment variable settings and sets up the menus for testing and execution commands in 'spcoin-hardhat-contracts-ts-access'.
Running the Contract tests through HardHat using NodeJS
// TESTING
// VISUAL STUDIO CODE INSTALL PLUGIN Nomic Foundation
// INSTALLING HARDHAT npm install --save-dev hardhat
//REQUIRED SUPPORT PACKAGES "@nomicfoundation/hardhat-toolbox": "^2.0.1" npm install --save-dev @nomicfoundation/hardhat-toolbox @nomiclabs/hardhat-ethers 'ethers@^5.0.0'
Add the following code snippet at the top of your hardhat.config.js file require("@nomicfoundation/hardhat-toolbox");
npm audit fix --force
// IMPORTANT HARDHAT GLOBAL COMMANDS npx hardhat help
dataStructureModel Inheritance Level SPCoin Token Staking Manager Transactions AgentRates Agent RecipientRates Recipient Account
To Add a Recipient Account Agent, add the following: Add a Rate Record to Agent
Using: addAgents(Recipient, SponsorRate, Agent) Example: addAgents(2, 10, 6);
Add a Rate Record to Recipient
Create: AddRecipientRate(Account, Recipient, RecipientRatePercent); Example: AddRecipientRate(1, 2, 10);
Add a Rate Record to Recipient
Create: AddAgentRate(Account, Recipient, Agent, RecipientRatePercent, AgentRatePercent); Example: AddAgentRate(1, 2, 6, 10, 10);
Add a Recipient Transaction
Create AddRecipientTransaction(Account, Recipient, RecipientRate, amount); Example: AddRecipientTransaction(1, 2, 10, 123.1230);
Add an Agent Transaction
Create addSponsorship(Recipient, RecipientRate, Agent, AgentRate, Amount) Example: AddAgentRate(1, 2, 6, 10, 10, 123.1230);
Requirements to Delete Agent: Agent Affiliation Program 1. Require Agent to be child of Recipient 2. Require Agent to have No RecipientCoin balanceOf Token affiliation with Parent. 3. Must Remove from parent Recipient.agentAccountList 4. Then Remove Recipient Parent from agentAccount.agentParentRecipientAccountList 5. Optional, If Agent account balanceOf is zero (0), Agent account may be deleted.
Requirements to Delete Recipient from Sponsor: (Delete Sponsor recipient) 1. Require Recipient to be Child of Sponsor 2. Require Recipient to have no Parent Patreon balanceOf Token affiliation. 3. Require Recipient to have no Child Agent affiliation 4. Remove associated child agents from Recipient.agentAccountList 5. Remove from Account ParentKeys, account.recipientAccountList 6. Remove from Account.recipientMap, 7. Optional, If Recipient account balanceOf is zero (0), Recipient account may be deleted.
Requirements to Delete Account 1. Require Account to have No Recipient, account.recipientAccountList must be zero (0). 2. Require Account to have No Agent, account.agentAccountList must be zero (0). 3. Optional, Require Account to have No Sponsors account.sponsorAccountList must be zero (0). 4. Optional, Require Account to have No account.agentParentRecipientAccountList must be zero (0).
Video Tutorial
- Comprehensive Video Tutorial Currently Under Construction. Resource will be posted as soon as it is ready for publication.
[](https://youtu.be/T_d5-y8hpYI "spcoin-hardhat-contracts-ts-access ~ A brief overview")
About the Authors
- Name: Robert Lanson
- Position Lead Architect/CEO
- Email: sponsorcoin@yahoo.com
9555334f5c2b06d36cb98e82326646092c837087
7 months ago