Lesson 34 of 34
In Progress

# Next Steps for Continuing to Learn Solidity

##### Yasin Cakal

Congratulations on completing this course on Solidity! By now, you should have a strong foundation in the basics of Solidity and be well-equipped to begin writing your own smart contracts.

## Next Steps

However, the journey doesn’t stop here. There is always more to learn and new developments in the world of Ethereum and smart contracts. Here are some suggestions for how you can continue to improve your Solidity skills:

1. Practice, practice, practice! The best way to become proficient in any skill is to put it into practice. Try writing your own contracts, experimenting with different features and design patterns, and testing your code thoroughly.
2. Stay up to date with the latest developments in Solidity and the Ethereum ecosystem. Follow blogs and social media accounts of industry leaders and developers, attend meetups and conferences, and participate in online communities to stay in the loop.
3. Dive deeper into specific topics that interest you. There are many resources available online that cover advanced Solidity concepts, such as optimization, security, and scalability. Consider taking an advanced course or workshop to further your knowledge.
4. Contribute to the Solidity community. Whether it’s by answering questions on forums, writing documentation, or contributing to open-source projects, there are many ways to give back to the community and help others learn.
5. Explore the real-world applications of Solidity. There are many projects out there that are using Solidity to solve real-world problems, from supply chain management to voting systems. Take a look at some of these projects and see how you can get involved.

## Conclusion

By following these steps, you will be well on your way to becoming a proficient Solidity developer and making a meaningful impact in the world of Ethereum and smart contracts.

## Exercises

To review these concepts, we will go through a series of exercises designed to test your understanding and apply what you have learned.

#### Write a function in Solidity that takes in two uint values and returns the larger of the two.

function largerNumber(uint x, uint y) public pure returns (uint) {
if (x > y) {
return x;
} else {
return y;
}
}


#### Write a Solidity contract that stores a list of student names and their respective grades. The contract should have a function that allows a teacher to add a new student and their grade, and a function that allows a student to retrieve their own grade.

pragma solidity ^0.7.0;

contract StudentGrades {
mapping(address => uint) public grades;
mapping(address => string) public names;

function addStudent(string memory _name, uint _grade) public {
require(names[msg.sender] == "", "Student already exists");
names[msg.sender] = _name;
grades[msg.sender] = _grade;
}

function getGrade(address _student) public view returns (uint) {
return grades[_student];
}
}


#### Write a Solidity function that takes in an array of integers and returns the sum of all the elements in the array.

function sumArray(int[] _array) public pure returns (int _sum) {
for (uint i = 0; i < _array.length; i++) {
_sum += _array[i];
}
return _sum;
}


#### Write a Solidity contract that allows a user to send ether to the contract and adds it to their balance. The contract should also have a function that allows the user to withdraw their balance.

pragma solidity ^0.7.0;

contract SimpleBank {
mapping(address => uint) public balances;

function deposit() public payable {
balances[msg.sender] += msg.value;
}

function withdraw(uint _amount) public {
require(balances[msg.sender] >= _amount, "Insufficient balance.");
msg.sender.transfer(_amount);
balances[msg.sender] -= _amount;
}
}


#### Write a Solidity contract that allows a user to register their name and age. The contract should have a function that returns the name and age of a user given their address.

pragma solidity ^0.7.0;

contract UserRegistry {
struct User {
string name;
uint age;
}

mapping(address => User) public users;

function registerUser(string memory _name, uint _age) public {
users[msg.sender].name = _name;
users[msg.sender].age = _age;
}

function getUser(address _address) public view returns (string memory _name, uint _age) {
User storage user = users[_address];
_name = user.name;
_age = user.age;
}
}