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.
@vasa-develop
vasa-develop / aviondb-browser-example.html
Created May 3, 2020 10:38
Using AvionDB with Browser
<!--Using AvionDB in Browser-->
<!--IPFS CDN Link-->
<script src="https://cdn.jsdelivr.net/npm/ipfs/dist/index.min.js"></script>
<!--AvionDB CDN Link-->
<script src="https://unpkg.com/aviondb/dist/aviondb.min.js"></script>
<script type="text/javascript">
const runExample = async () => {
const ipfs = await window.Ipfs.create();
// Creates a db named "DatabaseName"
@vasa-develop
vasa-develop / aviondb-example.js
Created May 3, 2020 10:37
Using AvionDB with Node.js
// Import modules
const AvionDB = require("aviondb");
const IPFS = require("ipfs");
const ipfs = new IPFS();
const runExample = async () => {
await ipfs.ready;
// Creates a db named "DatabaseName"
const aviondb = await AvionDB.init("DatabaseName", ipfs);
@vasa-develop
vasa-develop / go-ipld-p2-5.go
Created January 22, 2020 22:10
SimpleAsWater Tutorial: Hands On IPLD Tutorial: PART 2
// Fetch the details by reading the DAG for key "inputKey"
fmt.Printf("READ: Reading the document details of employee by ID: \"%s\"\n", inputID)
start = time.Now()
document, err := GetDocument(cid, inputID)
elapsed = time.Since(start)
if err != nil {
fmt.Println(err)
}
fmt.Printf("READ: Salary of employee ID %s is %s\n", string(inputID), string(document.Salary))
@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 / go-ipld-p2-3.go
Created January 22, 2020 22:09
SimpleAsWater Tutorial: Hands On IPLD Tutorial: PART 2
// Map the struct instance to the mapping
DocStoreMap[inputID] = employeeObject
// Converting the map into JSON object
entryJSON, err := json.Marshal(DocStoreMap)
if err != nil {
fmt.Println(err)
}
// Display the marshaled JSON object before sending it to IPFS
@vasa-develop
vasa-develop / go-ipld-p2-2.go
Created January 22, 2020 22:08
SimpleAsWater Tutorial: Hands On IPLD Tutorial: PART 2
scanner := bufio.NewScanner(os.Stdin)
fmt.Println("Enter the ID of the employee: ")
scanner.Scan()
inputID := scanner.Text()
fmt.Println("Enter the name of the employee: ")
scanner.Scan()
inputName := scanner.Text()
@vasa-develop
vasa-develop / go-ipld-p2-2.go
Created January 22, 2020 22:07
SimpleAsWater Tutorial: Hands On IPLD Tutorial: PART 2
// Map the struct instance its own ID
DocStoreMap := make(map[string]SampleStruct)