03-16-2021, 03:16 AM
I created my first memecoin!
<!-- SC_OFF --><div class="md"><p><strong>Note</strong>: This is not an offering, shilling, or anything else. Just tech talk. </p> <p>I've dabbled in programming for years but I'm not very good at it... still, I wanted to learn more about tokens and contracts by creating my own token. </p> <p>I present to you: <a href="https://rinkeby.etherscan.io/token/0x4903f648abe73776125d035a5588b5110fefe9cd">Avatar AANG</a></p> <p>It's only on rinkeby (testnet) because I'm just screwing around. It's also completely horribly written, not making use of any industry-standard libraries like open-zeppelin because what fun is that. Still, I feel pretty accomplished and this was a great step to actually understanding a bit of the tokens and technologies I'm putting my money into, and I only spent a day learning and toying with it. I'd encourage anyone with some coding skills to try it!</p> <p>More details:</p> <ul> <li>The contract is named BaSingSe, because there is no bank in Ba Sing Se.</li> <li>3 billion tokens were minted on creation which I'm the proud owner of. On the testnet, but still.</li> <li>Includes functions to delegate wallet actions (Air), transfer funds (Water), burn tokens (Fire), and store/retrieve SHA hashes (Earth)</li> </ul> <p>You can see the contract details on etherscan. I used Remix with Solidity 0.7.6. </p> <p>I was able to add my AANG to MetaMask, and even send some <a href="https://imgur.com/a/Ce4N43l">to another test wallet</a>! From there, I wrote some quick Python code to interact with the test wallet and validate the amounts on Rinkeby:</p> <pre><code>wallet_test % cat test.py import json import hashlib from web3 import Web3 from web3.middleware import geth_poa_middleware from dotenv import load_dotenv load_dotenv() import os INFURA_ACCESS_TOKEN = os.getenv("INFURA_ACCESS_TOKEN"
INFURA_PROJECT = os.getenv("INFURA_PROJECT"
WALLET_ADDRESS = os.getenv("WALLET_ADDRESS"
WALLET_PRIVATE_KEY = os.getenv("WALLET_PRIVATE_KEY"
CONTRACT_ADDRESS = "0x4903F648ABe73776125d035a5588b5110FefE9CD" with open('aang.json'
as f: CONTRACT_ABI = json.load(f) testnet = "https://:" + INFURA_ACCESS_TOKEN + "@rinkeby.infura.io/v3/" + INFURA_PROJECT web3 = Web3(Web3.HTTPProvider(testnet)); web3.middleware_onion.inject(geth_poa_middleware, layer=0) if web3.isConnected(): print("You are connected to the Ethereum test network."
balance = web3.eth.getBalance(WALLET_ADDRESS) print() print("Current Balances"
print("----------------"
print(str(web3.fromWei(balance, "ether"
) + " ETH"
AANG = web3.eth.contract(address=CONTRACT_ADDRESS, abi=CONTRACT_ABI) print(str(AANG.caller.balanceOf(WALLET_ADDRESS) / 1000000000000000000) + " AANG"
print() </code></pre> <p>After running it, I got my results!</p> <pre><code>wallet_test % pipenv run python test.py Loading .env environment variables… You are connected to the Ethereum test network. Current Balances ---------------- 1.99433569 ETH 1000.0 AANG </code></pre> <p>I know this probably isn't horribly impressive or exciting but it was really awesome to interact with blockchain and crypto at this level. I'm excited to do more!</p> </div><!-- SC_ON --> submitted by <a href="https://www.reddit.com/user/SiON42X"> /u/SiON42X </a> <br/> <span><a href="https://www.reddit.com/r/CryptoCurrency/comments/m5n9lt/i_created_my_first_memecoin/">[link]</a></span> <span><a href="https://www.reddit.com/r/CryptoCurrency/comments/m5n9lt/i_created_my_first_memecoin/">[comments]</a></span>Kind Regards R
<!-- SC_OFF --><div class="md"><p><strong>Note</strong>: This is not an offering, shilling, or anything else. Just tech talk. </p> <p>I've dabbled in programming for years but I'm not very good at it... still, I wanted to learn more about tokens and contracts by creating my own token. </p> <p>I present to you: <a href="https://rinkeby.etherscan.io/token/0x4903f648abe73776125d035a5588b5110fefe9cd">Avatar AANG</a></p> <p>It's only on rinkeby (testnet) because I'm just screwing around. It's also completely horribly written, not making use of any industry-standard libraries like open-zeppelin because what fun is that. Still, I feel pretty accomplished and this was a great step to actually understanding a bit of the tokens and technologies I'm putting my money into, and I only spent a day learning and toying with it. I'd encourage anyone with some coding skills to try it!</p> <p>More details:</p> <ul> <li>The contract is named BaSingSe, because there is no bank in Ba Sing Se.</li> <li>3 billion tokens were minted on creation which I'm the proud owner of. On the testnet, but still.</li> <li>Includes functions to delegate wallet actions (Air), transfer funds (Water), burn tokens (Fire), and store/retrieve SHA hashes (Earth)</li> </ul> <p>You can see the contract details on etherscan. I used Remix with Solidity 0.7.6. </p> <p>I was able to add my AANG to MetaMask, and even send some <a href="https://imgur.com/a/Ce4N43l">to another test wallet</a>! From there, I wrote some quick Python code to interact with the test wallet and validate the amounts on Rinkeby:</p> <pre><code>wallet_test % cat test.py import json import hashlib from web3 import Web3 from web3.middleware import geth_poa_middleware from dotenv import load_dotenv load_dotenv() import os INFURA_ACCESS_TOKEN = os.getenv("INFURA_ACCESS_TOKEN"
INFURA_PROJECT = os.getenv("INFURA_PROJECT"
WALLET_ADDRESS = os.getenv("WALLET_ADDRESS"
WALLET_PRIVATE_KEY = os.getenv("WALLET_PRIVATE_KEY"
CONTRACT_ADDRESS = "0x4903F648ABe73776125d035a5588b5110FefE9CD" with open('aang.json'
as f: CONTRACT_ABI = json.load(f) testnet = "https://:" + INFURA_ACCESS_TOKEN + "@rinkeby.infura.io/v3/" + INFURA_PROJECT web3 = Web3(Web3.HTTPProvider(testnet)); web3.middleware_onion.inject(geth_poa_middleware, layer=0) if web3.isConnected(): print("You are connected to the Ethereum test network."
balance = web3.eth.getBalance(WALLET_ADDRESS) print() print("Current Balances"
print("----------------"
print(str(web3.fromWei(balance, "ether"
) + " ETH"
AANG = web3.eth.contract(address=CONTRACT_ADDRESS, abi=CONTRACT_ABI) print(str(AANG.caller.balanceOf(WALLET_ADDRESS) / 1000000000000000000) + " AANG"
print() </code></pre> <p>After running it, I got my results!</p> <pre><code>wallet_test % pipenv run python test.py Loading .env environment variables… You are connected to the Ethereum test network. Current Balances ---------------- 1.99433569 ETH 1000.0 AANG </code></pre> <p>I know this probably isn't horribly impressive or exciting but it was really awesome to interact with blockchain and crypto at this level. I'm excited to do more!</p> </div><!-- SC_ON --> submitted by <a href="https://www.reddit.com/user/SiON42X"> /u/SiON42X </a> <br/> <span><a href="https://www.reddit.com/r/CryptoCurrency/comments/m5n9lt/i_created_my_first_memecoin/">[link]</a></span> <span><a href="https://www.reddit.com/r/CryptoCurrency/comments/m5n9lt/i_created_my_first_memecoin/">[comments]</a></span>Kind Regards R
