Skip to content

Instantly share code, notes, and snippets.

View vibern0's full-sized avatar
🥸
do you even blockchain?

Bernardo vibern0

🥸
do you even blockchain?
View GitHub Profile
uint256 myvar = 5;
const x = 5;
x = 6;
parser.visit(ast, {
FunctionDefinition: function(node) {
console.log(node)
}
})
variableDeclaration
: typeName storageLocation? identifier ;
typeName
: elementaryTypeName
| userDefinedTypeName
| mapping
| typeName '[' expression? ']'
| functionTypeName
| 'address' 'payable' ;
elementaryTypeName
/** @dev This is the Sum contract.
* @title Sum Contract
* @author username
*/
contract Sum {
/**
* @dev This method transfer fund to other user
* @param from the address extract funds
* @param to the user address to give funds
* @param amount the amount to transfer
{
"type":"SourceUnit",
"children":[
{
"type":"ContractDefinition",
"natspec":{
"dev":"This is the Sum contract.",
"title":"Sum Contract",
"author":"username"
},
{
"type":"SourceUnit",
"children":[
{
"type":"ContractDefinition",
"natspec":{
"dev":"This is the Sum contract.",
"title":"Sum Contract",
"author":"username"
},
// initialize notify
const notify = Notify(options)
// get users' account address
const accounts = await window.ethereum.enable()
// send a transaction
web3.eth
.sendTransaction({
from: accounts[0],
handleSubmit = (event) => {
const { MyToken, transferAmount, transferTo, userAccount } = this.state;
MyToken.transfer(transferTo, transferAmount, { from: userAccount });
event.preventDefault();
}
git submodule update --init --recursive  
git submodule update --recursive --remote