Skip to content

Instantly share code, notes, and snippets.

View vasa-develop's full-sized avatar
💭

vasa vasa-develop

💭
View GitHub Profile
@vasa-develop
vasa-develop / ERC721_3.sol
Created January 20, 2024 14:40
Case 3: Non-standard ERC721 contract: Transfer event is not emitted after an actual transfer (state change): 0x23A892B02A3576e05367ed11a6d54178E8ade564
/**
*Submitted for verification at Etherscan.io on 2020-04-01
*/
pragma solidity ^0.5.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
@vasa-develop
vasa-develop / ERC721_2.sol
Created January 20, 2024 14:38
Case 2: Non-standard ERC721 contract: Transfer event is emitted without an actual transfer (state change): 0xA0a5cc6ED4C34509Db6A9Be909cFf0EC869aD67f
/**
*Submitted for verification at Etherscan.io on 2020-04-01
*/
pragma solidity ^0.5.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
@vasa-develop
vasa-develop / ERC721_1.sol
Created January 20, 2024 14:35
Case 1: Standard ERC721 Contract: Transfer event is emitted with an actual transfer (state change): 0x2AFbe33C5109B97005b733d45BFC5Fd4e0A2432b
/**
*Submitted for verification at Etherscan.io on 2020-04-01
*/
pragma solidity ^0.5.0;
/**
* @dev Contract module which provides a basic access control mechanism, where
* there is an account (an owner) that can be granted exclusive access to
* specific functions.
//if something breaks, go to this file: https://github.com/jpmorganchase/quorum-examples/blob/master/vagrant/bootstrap.sh
# install build deps
sudo add-apt-repository ppa:ethereum/ethereum
sudo apt-get update
sudo apt install make
sudo apt install g++ -y
sudo apt-get install -y build-essential unzip libdb-dev libleveldb-dev libsodium-dev zlib1g-dev libtinfo-dev solc sysvbanner wrk software-properties-common default-jdk maven
//installing go
@vasa-develop
vasa-develop / moon_03.js
Created December 28, 2019 12:36
SimpleAsWater: Building a Chat Application using Libp2p
'use strict'
/* eslint-disable no-console */
const PeerId = require('peer-id')
const PeerInfo = require('peer-info')
const Node = require('./libp2p_bundle')
const pull = require('pull-stream')
const Pushable = require('pull-pushable')
const p = Pushable()
const chalk = require('chalk');
const emoji = require('node-emoji')
@vasa-develop
vasa-develop / EtherGame.sol
Created July 21, 2018 18:30
THIS CODE IS SAFE.
contract EtherGame {
uint public payoutMileStone1 = 3 ether;
uint public mileStone1Reward = 2 ether;
uint public payoutMileStone2 = 5 ether;
uint public mileStone2Reward = 3 ether;
uint public finalMileStone = 10 ether;
uint public finalReward = 5 ether;
uint public depositedWei;
@vasa-develop
vasa-develop / EtherStore.sol
Created July 21, 2018 18:18
DO NOT USE THIS CODE. THIS CODE IS USED TO DEMONSTRATE A VULNERABILITY IN A SOLIDITY CODE.
contract EtherStore {
uint256 public withdrawalLimit = 1 ether;
mapping(address => uint256) public lastWithdrawTime;
mapping(address => uint256) public balances;
function depositFunds() public payable {
balances[msg.sender] += msg.value;
}
function withdrawFunds (uint256 _weiToWithdraw) public {
pragma solidity ^0.5.11;
import "./Product.sol";
import "./Addition.sol";
import "./ResultStorage.sol";
contract Calculator is ResultStorage {
Product public product;
Addition public addition;
@vasa-develop
vasa-develop / go-ipld-p2-4.go
Created January 22, 2020 22:10
SimpleAsWater Tutorial: Hands On IPLD Tutorial: PART 2
// GetDocument handles READ operations of a DAG entry by CID, returning the corresponding document
func GetDocument(ref, key string) (out SampleStruct, err error) {
err = sh.DagGet(ref+"/"+key, &out)
return
}
@vasa-develop
vasa-develop / Attack.sol
Created July 21, 2018 18:20
DO NOT USE THIS CODE. THIS CODE IS USED TO DEMONSTRATE A VULNERABILITY IN A SOLIDITY CODE.
import "EtherStore.sol";
contract Attack {
EtherStore public etherStore;
// intialise the etherStore variable with the contract address
constructor(address _etherStoreAddress) {
etherStore = EtherStore(_etherStoreAddress);
}
function pwnEtherStore() public payable {
// attack to the nearest ether