Skip to content

Programming smart contracts with Solidity and deploying them to an Ethereum blockchain network using Ganache

Notifications You must be signed in to change notification settings

tamobee/first-contract-solidity

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

14 Commits
 
 
 
 
 
 
 
 

Repository files navigation

First Contract in Solidity

Files


To Note

  • Before developing and testing the contracts, I have my blockchain network running in Ganache and MetaMask extension connected and pointing to Localhost:8545.

  • In the Deploy tab in Remix IDE, I connected to my local Ganache chain by selecting Injected Web3 in the Environment column.

  • For each contract, I filled in the constructor parameters with the designated employee addresses before transacting and deploying.


Level One: AssociateProfitSplitter.sol Contract

This contract accepts Ether and divides it evenly between Associate-level employees. This allows the Human Resources department to pay employees quickly and efficiently.

Compile AssociateProfitSplitter.sol

Remix

Deploy AssociateProfitSplitter.sol

Remix

Level Two: TieredProfitSplitter.sol Contract

In this contract rudimentary percentages are calculated for different tiers of employees (CEO, CTO, and Bob). The incoming Ether is distributed at different levels: CEO – 60%; CTO – 25%; Bob – 15%.

Compile TieredProfitSplitter.sol

Remix

Deploy TieredProfitSplitter.sol

Remix

Level Three: DeferredEquityPlan.sol Contract

In This contract 1000 shares are automatically distributed over 4 years to the employee, deployed by HR.

Compile and Deploy DeferredEquityPlan.sol

For testing purposes, I created a new variable uint fakenow = now; and utilized the function to fast forward by 100 days:

   function fastforward() public {
       fakenow += 100 days;
   }

Remix

About

Programming smart contracts with Solidity and deploying them to an Ethereum blockchain network using Ganache

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published