You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Interact with the changeOwner function - in 2_Owner.sol
Hint: you need to input an account address that is not the address of the 1st account in the ACCOUNT select box. If you switch to a different account to copy, remember to switch back to the original account.
Start a debugging session from the terminal
Find out what the solidity state & local variables are at different points by dragging the slider or stepping through the transaction.
Switch back to the Deploy & Run Module. Then deploy to another testnet (ganache, hardhat, or a public test chain with Metamask)
More Advanced (but often used) Tasks
Console.log & Switching Accounts
Check the use of console.log in 2_Owner.sol
Edit the message on line 33.
Compile and deploy the contract.
Find your message in the terminal.
Try putting a console.log in the changeOwner function.
Compile and Deploy the contract.
Open up the deployed instance and find the changeOwner function.
Change the account and copy the new account.
Switch back to the original account.
Paste the account address that you copied into changeOwner's parameter newOwner.
Click the changeOwner button.
Why did you need to change back to the original account to run this function?
Find the console.log message you put in this function.
Sending value with a transaction
Make a function changeOwner payable:
Add the word payable after the word public on line 42. - - - Compile the contract and deploy it to the Remix VM.
Send 4 ETH to the contract (using our not so intuitive UI)
Check gas usage of the function - see gas line in the editor
In the deployed instance, see how much value has been sent to the contract.
Cloning
In the File Explorer, click the clone icon on the row of Workspace icons.
and use this repo - or any other you like: https://github.com/Aniket-Engg/solidity-school.git