Skip to content

Latest commit

 

History

History
62 lines (39 loc) · 1.13 KB

README.md

File metadata and controls

62 lines (39 loc) · 1.13 KB

Subscription Solidity Contract

Project made to create simple subscriptions solution in web3. Made with Solidity, Hardhat and Typescript

1. Functions

  • createPlan: create a new plan using the sender address
  • subscribe: subscribe sender address to a plan
  • cancel: cancel plan for sender address
  • pay: receive the eth for plans

2. How to compile and test:

  npm install
  npm run compile
  npm run test


3. How to deploy to Rinkey network

  • Copy .env.example to .env
  • Edit .env file adding:
    • alchemy api key to RINKEBY_URL
    • PRIVATE_KEY

After compile and test execute the following command:

  npm run deploy-rinkeby


4. Deployed Contract Address to Rinkeby

Address: 0x72280e0A0C1C1c98F1965219B0342082b7B3f5B5

Verified in Etherscan: https://rinkeby.etherscan.io/address/0x72280e0A0C1C1c98F1965219B0342082b7B3f5B5#code





5. Verify the contract in Etherscan

To verify deployed contract update .env file with etherscan api key in variable ETHERSCAN_KEY, then run the following command:

  npx hardhat verify CONTRACT_ADDRESS --network rinkeby