Crates.io | wrapped-azero |
lib.rs | wrapped-azero |
version | 1.0.0 |
source | src |
created_at | 2024-05-06 14:47:31.531672 |
updated_at | 2024-05-06 14:47:31.531672 |
description | Smart contract for AZERO coin wrapped as a PSP22 token |
homepage | https://github.com/Cardinal-Cryptography/wAZERO |
repository | https://github.com/Cardinal-Cryptography/wAZERO |
max_upload_size | |
id | 1231209 |
size | 106,988 |
This repository contains an ink! smart contract for Aleph Zero blockchain which enables wrapping the native chain coin (AZERO) into a fungible token following PSP22 standard.
The contract is deployed to both test and main networks under the following addresses:
5CtuFVgEUz13SFPVY6s2cZrnLDEkxQXc19aXrNARwEBeCXgg
5EFDb7mKbougLtr5dnwd5KDfZ3wK55JPGPLiryKq4uRMPR46
The artifacts
folder contains the exact compiled binary that has been deployed, as well as all other compilation artifacts for verification purposes.
The contents of this repository has been published to crates.io to allow for easy integration from other projects.
Cargo.toml
:wrapped-azero = { version = "1.0", default-features = false, features = ["ink-as-dependency"] }
# ...
[features]
# ...
std = [
# ...
"wrapped-azero/std",
]
deposit
and withdraw
methods from your contract, use contract_ref
macro with WrappedAZERO
trait:use ink::{codegen::TraitCallBuilder, contract_ref};
use wrapped_azero::{WrappedAZERO, MAINNET};
let mut wazero: contract_ref!(WrappedAZERO) = MAINNET.into();
wazero.withdraw(amount); // returns Result<(), PSP22Error>
// Deposit call must be composed manually to be able to attach AZERO transfer
wazero.call_mut().deposit().transferred_value(amount).invoke(); // returns Result<(), PSP22Error>
contract_ref
macro with PSP22
trait:use ink::contract_ref;
use ink::prelude::vec;
use wrapped_azero::{PSP22, MAINNET};
let mut wazero: contract_ref!(PSP22) = MAINNET.into();
let balance = wazero.balance_of(some_account);
wazero.transfer(recipient, value, vec![]); // returns Result<(), PSP22Error>
artifacts
folder.psp22::balanceOf
) you will see the response immediately. For other methods fill in the parameters (leave all the limits with their default values) and sign the transaction (you need to have Aleph Zero Signer or similar browser extension connected with Contracts UI).