Comprehensive guide to interact with the VetorChain blockchain. Build decentralized applications, deploy smart contracts, and integrate with our high-performance blockchain.
The Vetorchain Testnet is not yet live, all of these informations below are to explain what will happen when our testnet goes live.
Returns the current state of the blockchain including blocks, transactions, and network stats.
Submit a signed transaction to the network.
{
"sender": "0x74f3d56c550c2e18165259d7975dbf0b32eb4955",
"receiver": "0x...",
"amount": 1000000000000000000, // 1 VeLC
"gas_fee": 500000000000000, // 0.0005 VeLC
"signature": "3045022100...",
"nonce": 1
}{
"sender": "0x74f3d56c550c2e18165259d7975dbf0b32eb4955",
"receiver": "0x...",
"amount": 1000000000000000000, // 1 VeLC
"gas_fee": 500000000000000, // 0.0005 VeLC
"signature": "3045022100...",
"nonce": 1
}Deploy a new smart contract to the blockchain.
{
"transaction": {
"sender": "0x...",
"receiver": "",
"amount": 0,
"gas_fee": 500000000000000,
"nonce": 2,
"signature": "3045022100..."
},
"contract_type": "token",
"bytecode": "0x608060405234801561001057...",
"language": "solidity",
"name": "MyToken",
"symbol": "MTK",
"standard": "vrct",
"metadata": {
"category": "utility"
}
}{
"transaction": {
"sender": "0x...",
"receiver": "",
"amount": 0,
"gas_fee": 500000000000000,
"nonce": 2,
"signature": "3045022100..."
},
"contract_type": "token",
"bytecode": "0x608060405234801561001057...",
"language": "solidity",
"name": "MyToken",
"symbol": "MTK",
"standard": "vrct",
"metadata": {
"category": "utility"
}
}Get the current balance of an address in base units.
Stake VeLC to become a validator.
{
"address": "0x...",
"amount": 10000000000000000000 // 10 VeLC (minimum)
}{
"address": "0x...",
"amount": 10000000000000000000 // 10 VeLC (minimum)
}VetorChain Token Standard - Basic fungible token with metadata support
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract MyToken {
string public name;
string public symbol;
uint8 public decimals = 18;
uint256 public totalSupply;
string public category;
mapping(address => uint256) public balanceOf;
mapping(address => mapping(address => uint256)) public allowance;
event Transfer(address indexed from, address indexed to, uint256 value);
event Approval(address indexed owner, address indexed spender, uint256 value);
constructor(
string memory _name,
string memory _symbol,
uint256 _initialSupply,
string memory _category
) {
name = _name;
symbol = _symbol;
totalSupply = _initialSupply * 10 ** uint256(decimals);
balanceOf[msg.sender] = totalSupply;
category = _category;
}
function transfer(address _to, uint256 _value) public returns (bool success) {
require(balanceOf[msg.sender] >= _value);
balanceOf[msg.sender] -= _value;
balanceOf[_to] += _value;
emit Transfer(msg.sender, _to, _value);
return true;
}
// ... additional functions ...
}VetorChain Unique Asset Standard - For NFTs and unique digital assets
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract MyUniqueAsset {
string public name;
string public symbol;
string public baseURI;
mapping(uint256 => address) private _owners;
mapping(address => uint256) private _balances;
mapping(uint256 => address) private _tokenApprovals;
mapping(address => mapping(address => bool)) private _operatorApprovals;
event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);
event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);
event ApprovalForAll(address indexed owner, address indexed operator, bool approved);
constructor(string memory _name, string memory _symbol) {
name = _name;
symbol = _symbol;
}
function mint(address to, uint256 tokenId) public {
require(to != address(0), "VRCU: mint to the zero address");
require(_owners[tokenId] == address(0), "VRCU: token already minted");
_balances[to] += 1;
_owners[tokenId] = to;
emit Transfer(address(0), to, tokenId);
}
// ... additional functions ...
}
Join our developer community for support and collaboration: