Skip to content

Instantly share code, notes, and snippets.

View PowerStream3604's full-sized avatar
🎯
Focusing

David PowerStream3604

🎯
Focusing
View GitHub Profile
%lang starknet
from starkware.cairo.common.cairo_builtins import HashBuiltin
// Define a storage variable.
@storage_var
func balance() -> (res: felt) {
}
// Increases the balance by the given amount.
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
/**
* @title Storage
* @dev Store & retrieve value in a variable
* @custom:dev-run-script ./scripts/deploy_with_ethers.ts
*/
contract Storage {
@PowerStream3604
PowerStream3604 / ERC20.sol
Created October 6, 2022 08:11
Example Solidity Smart Contract for Immutable StarkNet Course
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.13;
interface IERC20 {
function totalSupply() external view returns (uint);
function balanceOf(address account) external view returns (uint);
function transfer(address recipient, uint amount) external returns (bool);

Complete tutorial of Unit Testing Ploygon Smart Contract with Truffle Framework

Overview of the tutorial

  • I am writing this tutorial to help other developers to implement a thorough test for Smart Contracts on Polygon.
  • We'll learn how to implement a smart-contract from scratch and unit test them using Truffle
  • This tutorials goal is to help developers to get a deep understanding of how unit testing works with Smart Contract on Polygon Network as a developer.

What we'll do in the tutorial.

  • Write our own Smart Contract for testing with solidity.
  • Compile & Deploy them with Truffle.
@PowerStream3604
PowerStream3604 / Interact with Polygon Smart Contract.md
Last active February 22, 2022 01:11
Write, Compile, Deploy, Interact with Contracts on Polygon network (Figment)

Complete tutorial of writing, compiling, deploying, interacting with smart contracts on Polygon Network with Full implementation

Overview of the tutorial

  • I am writing this tutorial to help other developers not to reinvent the wheel and go a much smoother way than I did.
  • We'll learn how to implement a smart-contract from scratch and compile -> deploy -> interact with them using Truffle
  • This tutorials goal is to help readers to get a comprehensive understanding of how to work with Smart Contract on Polygon Network as a developer.

Who is this tutorial for?

  • This tutorial is for developers who wants start working on polygon network.
  • It's good for readers to have prior knowlege about Truffle Framework and Ethereum network.
@PowerStream3604
PowerStream3604 / README.txt
Created May 17, 2021 09:36
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
@PowerStream3604
PowerStream3604 / README.txt
Created May 17, 2021 08:32
Created using remix-ide: Realtime Ethereum Contract Compiler and Runtime. Load this file by pasting this gists URL or ID at https://remix.ethereum.org/#version=soljson-v0.8.4+commit.c7e474f2.js&optimize=false&runs=200&gist=
REMIX EXAMPLE PROJECT
Remix example project is present when Remix loads very first time or there are no files existing in the File Explorer.
It contains 3 directories:
1. 'contracts': Holds three contracts with different complexity level, denoted with number prefix in file name.
2. 'scripts': Holds two scripts to deploy a contract. It is explained below.
3. 'tests': Contains one test file for 'Ballot' contract with unit tests in Solidity.
SCRIPTS
import sys
sys.path.append("../")
import requests
import os
from bs4 import BeautifulSoup
from selenium.webdriver.support.ui import WebDriverWait
from selenium.webdriver.support import expected_conditions as EC
from selenium.common.exceptions import TimeoutException
from seleniumwire import webdriver