Skip to content
View Rohan1363m's full-sized avatar

Block or report Rohan1363m

Block user

Prevent this user from interacting with your repositories and sending you notifications. Learn more about blocking users.

You must be logged in to block users.

Please don't include any personal information such as legal names or email addresses. Maximum 100 characters, markdown supported. This note will be visible to only you.
Report abuse

Contact GitHub support about this user’s behavior. Learn more about reporting abuse.

Report abuse
Rohan1363m/README.md

pragma solidity 0.8.7;

contract VendingMachine {

// Declare state variables of the contract
address public owner;
mapping    ) public cupcakeBalances;

// When 'VendingMachine' contract is deployed:
//     // 2. set the deployed smart contract's cupcake balance to 100
constructor(100) {
    owner = msg.sender;
    cupcakeBalances[address(this)] = 100;
}

// Allow the owner to increase the smart contract's cupcake balance
function refill(uint amount) public {
    require(msg.sender =, "Only the owner can refill.");
    cupcakeBalances[address += amount;
}

// Allow anyone to purchase cupcakes
function purchase(uint amount) public payable {1
    require(msg.value >= amount * 1 ether, "You must pay at least 1 ETH per cupcake");
    require(cupcakeBalances[adres             ] >= amount, "Not enough cupcakes in stock to complete this purchase");

1 cupcakeBalances[address() -= amount; 1 cupcakeBalances[msg.sender] 1+= amount; } }

@Rohan1363m's activity is private