Package: cupcakes
CupcakeEasily compile, test, and deploy smart contractsCupcake is a development enviroment to compile, test, and deploy Ethereum smart contracts. It automates the process down to a few lines of code for most complex operations, while continuing to maintain versatility. The built-in network makes testing just work without any additional setup. Optionally, Ganache can easily be used as a provider.Interact with existing contracts and send etherCupcake comes with a scripting workspace for sending ether and interacting with other smart contracts on the blockchain.SourceClone cupcakegh repo clone 0xver/cupcakeInstall cupcakepip install .PyPiInstall cupcakepip install cupcakesGetting StartedStart new cupcake project and select optioncupcakeOpen the projectcd nameView the command optionscupcakeCompileCompile smart contractscupcake bakeTestTest smart contractscupcake frostDeployDeploy smart contractscupcake serveInteractInteract with smart contracts through the script workspacecupcake shopAPIFunctionParametersaccount(provider)(Optional)provider(type)compile(source)(Optional)"Contract"contract(provider, address, abi)provider(type),0x..., "[]"deploy(source, constructor, provider, key_pair)"Contract", (Optional) ["constructor arguments"],provider(type), (Optional)account()install(version)(Optional)0.0.0provider(type)"Custom","Ganache"read(contract, function, args, expect)contract(provider, address, abi),"function", (Optional)"args", (Optional)<expect>send(provider, to, amount, gas, sender, key_pair, chain)provider(type),0x...,eth(1), (Optional)50, (Optional)account()[1], (Optional)account(), (Optional)1write(contract, function, args, value, gas, caller, key_pair, provider)contract(provider, address, abi),"function", (Optional)"args", (Optional)eth(1), (Optional)50, (Optional)account()[1], (Optional)account(), (Optional)provider(type)account(provider)The account function will convert a private key into a public key without any parameter argument or derive accounts from the provider. Returns key_pairaccount()and public keyaccount()[1]from the private key in .env or public addresses from a provider asaccount(provider)[1]throughaccount(provider)[9].compile(source)Optionally set source argument to return object. Compiler outputs contract ABIs tobuild/. RunsInstall()before compiling. Returns the source bytecodecompile()[0]and source ABIcompile()[1]only if the source argument is set.contract(provider, address, abi)Access an existing contract by giving a provider, contract address, and the contract's ABI. Returnscontractobject.deploy(source, constructor, provider, key_pair)Willcompile(source)contracts and deploy contracts from the provider. Optionally use an array of constructor arguments. Useaccount()for the optionalkey_pairparameter. The first address from the provider is used if nokey_pairare provided. Returnscontractobject.install(version)Installs version of Solidity or latest version if not argument is not set.provider(type)"Custom"and"Ganache"aretypearguments."Custom"and"Ganache"types are defined in config.yaml. Use the built in local network withprovider().read(contract, function, args, expect)Usecontract()ordeploy()for thecontractargument. Specify thefunctionas a string. Optionally useargsfor the contract function arguments. Optionally use theexpectargument to override the return.send(provider, to, amount, gas, sender, key_pair, chain)Sends ether from an account. Useaccount(provider)[1]for thesenderor useaccount()for thekey_pair. Usingkey_pairdoes not require thesenderargument. Usegasandchainonly ifkey_pairis used. Supportedchainstring arguments are"mainnet","ropsten","kovan", and"rinkeby". If nochainis provided, the Ethereum mainnet is used. Logs transaction hash totxs/.  Returnstransaction hash.write(contract, function, args, value, gas, caller, key_pair, provider)Usecontract()ordeploy()for thecontractargument. Specify thefunctionas a string. Optionally useargsfor the contract function's argument. Optionally usevalueif function requires ether. Usecalleror usegas,key_pairandproviderdepending on the setup. Logs transaction hash totxs/. Returnstransaction hash.Add private keyCreate .env file in project foldertouch .envAdd the private key to PRIVATE_KEY in the .env file and include 0xPRIVATE_KEY=0x...Enable GanacheAdd Ganache host and port in config.yamlNetwork:
    Ganache: http://127.0.0.1:7545Set theprovider(type)to Ganacheprovider("Ganache")Return automated messagesUsemsg("baked")ormsg("frosted")to return success messages. Usemsg(public_key=public_key, contract=contract)to return deployment message. Usemsg(tx=tx)to return transaction message.Convert ETH to WEIUseeth(value)to convert ETH to WEILoad ABI from json fileUsesource(abi/contract.json)to return ABISet gas limitAdd the following to config.yamlGas:
    Limit: 200000Change the .env file path locationAdd the following to config.yamlKey:
    Location: "path/.env"Change config.yaml network namesChange the config.yaml custom network name to enableprovider("Infura")Network:
    Infura:Print with colorUsep(object)toprint()with colorDisable ColorsAdd the following to config.yaml to disable colorsColors:
    Disable: True