Learn Solidity

Solidity is an object-oriented, high-level language for implementing smart contracts.

Companies and DAOs like Alium, PancakeSwap, Gelato Digital, Blocknative, Winter, Flashbots, RMRK, Fuel Labs, Clique and Fam use Solidity to work on AliumSwap, PancakeSwap, Blocknative, Winter, Flashbots, Singular, Sway, Clique, Fam and LiquiFi.

Conquer the basics of Solidity here and go pro once you get the hang of it. Average salaries for Solidity developers are approximately $100k-140k/yr.

Variables whose values are permanently stored on the blockchain:

uint quantity = 100;

To make a variable accessible from other smart contracts:

uint public quantity = 100;

A simple smart contract:

pragma solidity ^0.8.4; // version of Solidity this contract should run on

contract Test {
  uint quantity;

  constructor() {
    quantity = 100; // assign the initial value
  }
}

Let's add a setter and a getter:

pragma solidity ^0.8.4;

contract Test {
  uint quantity;

  constructor() {
    quantity = 100;
  }

  function set(uint newQuantity) public {
    quantity = newQuantity;
  }

  function get() public view returns (uint) {
    return quantity;
  }
}

The public keyword on the setter and getter lets us know that the methods can be called from the outside of the contract (by other smart contracts for example).

The view keyword indicates that the function will not alter the storage state in any way. It only "views" data.

The pure keyword indicates that not only will the function not write to storage, but it will also not read from storage:

function add(uint x, uint y) public pure returns (uint) {
  return x + y;
}

This is what if statements look like:

function conditionalAdd(uint x, uint y) public pure returns (uint) {
  if (x < 5) {
    return x + 5;
  } else if (y > 5) {
    return y + 5;
  } else {
    return x + y;
  }
}

Solidity supports ternary operators as well:

function conditionalAdd(uint x, uint y) public pure returns (uint) {
  return x < 5 ? x : x + y;
}
Hands-On Smart Contract Development with Solidity and Ethereum: From Fundamentals to Deployment

If you'd like to go beyond the basics, here's a good read:

Hands-On Smart Contract Development with Solidity and Ethereum: From Fundamentals to Deployment