Skip to content

Instantly share code, notes, and snippets.

View sorXCode's full-sized avatar
🥊
Python | Smart Contracts | DevOps | Flutter | AI | ML | jQuery | 8bits et al.

Victor Adeyanju sorXCode

🥊
Python | Smart Contracts | DevOps | Flutter | AI | ML | jQuery | 8bits et al.
View GitHub Profile
@sorXCode
sorXCode / Read.js
Created July 6, 2022 11:14
Reading storage layout in the EVM via web3.js
const Web3 = require("web3");
var web3 = new Web3("https://ropsten.infura.io/v3/YOUR-API-KEY"); // use a websocket connection
var contractAddress = "Contract Address"; //
getStorageValues();
async function getStorageValues(){
// #1 single variable uint
@sorXCode
sorXCode / SimpleStorage.sol
Created February 15, 2022 12:39
15-02-2022
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract SimpleStorage {
// this will get initialized as 0
uint256 favoriteNumber;
bool favoriteBool;
@sorXCode
sorXCode / ENS.sol
Created February 2, 2022 00:32
ENS snippet
// SPDX-License-Identifier: GPL-3.0
pragma solidity >=0.7.0 <0.9.0;
contract ENS {
// pricing: would be determined by number of characters in the desired name
// ownership: 1. one address can only have one ENS
// 2. user desired name is the ens
// 3. if name is taken, return 'unavailable'
// 4. extension is .w3bridge
@sorXCode
sorXCode / activity_graph.html
Created January 23, 2021 04:49
Activity Graph SVG
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
<title> Activity Graph </title>
<style>
.wday,
.calendar-graph text.month {
font-size: 12px;
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@sorXCode
sorXCode / duplicateCounter.py
Last active October 15, 2017 16:52
sol >> Write a function that will return the count of distinct case-insensitive alphabetic characters and numeric digits that occur more than once in the input string. The input string can be assumed to contain only alphabets (both uppercase and lowercase) and numeric digits.
#stepwise solution
def counter(word):
numberList = [] # empty list for numbers
alphaList = [] # empty list for alphabets
#sorting num and alpha from word into resp. list
for ch in word:
if ch.isdigit():
numberList.append(ch)