Commit 4b414db1 authored by Ricardo Rius's avatar Ricardo Rius Committed by Hero Bird

Erc721 example (#201)

* Erc721 basic

* Update to counter logic

* Simplify counter

* Some cleaning

* More cleaning

* Add mint and burn

* Refact counter

* Add mint test

* Add transfer-burn tests

* Add approve transfer test

* Fix error propagation

* Add tests

* Restric account 0x0

* Extend test cases

* Update Result type

Agree, it makes sense to use the Result type as defined on core.
Co-Authored-By: default avatarGavin Wood <github@gavwood.com>

* Change Result type

* Change Result return type

* Change ErrNo to enum

* Fix ABI layout error

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Implement to_u32 Error

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Update examples/lang/erc721/src/lib.rs
Co-Authored-By: Hero Bird's avatarHero Bird <robbepop@web.de>

* Add tons of comments
parent 17b0da58
Pipeline #55360 failed with stages
in 29 seconds
[target.wasm32-unknown-unknown]
rustflags = [
"-C", "link-args=-z stack-size=65536 --import-memory"
]
[package]
name = "abi-gen"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
publish = false
[[bin]]
name = "abi-gen"
path = "main.rs"
[dependencies]
contract = { path = "../..", package = "erc721", features = ["ink-generate-abi"] }
serde = { version = "1.0", features = ["derive"] }
serde_json = "1.0"
fn main() -> Result<(), std::io::Error> {
let abi = contract::ink_generate_abi();
let contents = serde_json::to_string_pretty(&abi)?;
std::fs::create_dir("target").ok();
std::fs::write("target/abi.json", contents)?;
Ok(())
}
[package]
name = "erc721"
version = "0.1.0"
authors = ["Parity Technologies <admin@parity.io>"]
edition = "2018"
[dependencies]
ink_abi = { path = "../../../abi", default-features = false, features = ["derive"], optional = true }
ink_core = { path = "../../../core", default-features = false }
ink_model = { path = "../../../model", default-features = false }
ink_lang = { path = "../../../lang", default-features = false }
scale = { package = "parity-scale-codec", version = "1.0", default-features = false, features = ["derive"] }
type-metadata = { git = "https://github.com/type-metadata/type-metadata.git", default-features = false, features = ["derive"], optional = true }
[lib]
name = "erc721"
crate-type = [
# Used for normal contract Wasm blobs.
"cdylib",
# Used for ABI generation.
"rlib",
]
[features]
default = ["test-env"]
std = [
"ink_abi/std",
"ink_core/std",
"ink_model/std",
"ink_lang/std",
"type-metadata/std",
"scale/std",
]
test-env = [
"std",
"ink_core/test-env",
"ink_model/test-env",
"ink_lang/test-env",
]
ink-generate-abi = [
"std",
"ink_abi",
"type-metadata",
"ink_core/ink-generate-abi",
"ink_lang/ink-generate-abi",
]
ink-as-dependency = []
[profile.release]
panic = "abort"
lto = true
opt-level = "z"
overflow-checks = true
[workspace]
members = [
".ink/abi_gen"
]
exclude = [
".ink"
]
This diff is collapsed.
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment