Skip to content

RootCee/BlockArkToken

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 
 
 
 
 

Repository files navigation

<<<<<<< HEAD Sure, here's the edited version with code blocks and bullet points for easy copy-pasting:

BlockArkToken Contract

The BlockArkToken contract is an ERC20 token contract with additional features for member and manager roles. The contract is written in Solidity and uses the OpenZeppelin library for the ERC20 and Ownable functionality.

Features

  • ERC20 Token: The contract creates an ERC20 token with a total supply of 999 tokens.
  • Members and Managers: The contract has a concept of members and managers. Initially, the addresses provided to the constructor are set as both members and managers.
  • Voting: Members can vote for other members. The voting power is proportional to the number of tokens the voter holds.
  • Manager Role: The contract owner can add and remove managers.

Deployment

To deploy this contract using Remix:

  1. Open Remix in your browser.
  2. Click on the "File Explorers" icon on the left sidebar, then click on the "+" icon to create a new file. Name it BlockArkToken.sol.
  3. Copy and paste the contract code into this file.
  4. Click on the "Solidity Compiler" icon on the left sidebar, select the correct compiler version (0.8.0), and click "Compile BlockArkToken.sol".
  5. Click on the "Deploy & Run Transactions" icon on the left sidebar.
  6. In the "Deploy" section, select the BlockArkToken contract. In the "value" field, enter the initial member addresses as an array. For example, if you have two initial members with addresses 0xAbc... and 0xDef..., you would enter ["0xAbc...", "0xDef..."].
  7. Click "Deploy".

Interacting with the Contract

After deployment, you can interact with the contract using the Remix interface, or programmatically using a library like Web3.js or Ethers.js.

Here are some of the key functions you can call:

  • vote(address _recipient): As a member, vote for another member. The voting power is proportional to the number of tokens you hold.
  • getVotes(address _member): Get the number of votes a member has received.
  • addManager(address _manager): As the contract owner, add a manager.
  • removeManager(address _manager): As the contract owner, remove a manager.

Backend Integration

To integrate this contract into a backend system, you would typically use a library like Web3.js or Ethers.js. These libraries allow you to interact with Ethereum contracts from JavaScript.

Here's a basic example of how you might initialize the contract using Web3.js:

const Web3 = require('web3');
const web3 = new Web3('https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID');

const contractABI = [...]; // Contract ABI
const contractAddress = '0x...'; // Contract address

const contract = new web3.eth.Contract(contractABI, contractAddress);

Once you've initialized the contract, you can call its functions. For example, to get the number of votes a member has received:

const votes = await contract.methods.getVotes('0x...').call();
console.log(votes);

Remember to replace '0x...' with the actual member address, and 'https://mainnet.infura.io/v3/YOUR_INFURA_PROJECT_ID' with your actual Infura project ID or another Ethereum node URL.

BlockArkToken

Block Ark Studio Token Contract $ARK

cb2d4975d6e4038972a150f4d487859edd964697

About

Block Ark Studio Token Contract $ARK

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors