Binary is a number system that uses only two digits: 0 and 1. Each digit is called a "bit" (binary digit).
Examples:
0 in binary = 0
1 in binary = 1
2 in binary = 10
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| import "./proxy/Proxiable.sol"; | |
| import "@openzeppelin/contracts/access/Ownable.sol"; | |
| import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; | |
| import "@openzeppelin/contracts/utils/Counters.sol"; | |
| import "@openzeppelin/contracts/utils/math/SafeMath.sol"; | |
| contract SurveysV2 { |
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| struct InnerStruct { | |
| uint256 innerValue; | |
| bytes data; | |
| } | |
| struct OuterStruct { | |
| uint256 outerValue; |
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| import "contracts/1_Storage.sol"; | |
| contract Example { | |
| // DATA-TYPES | |
| /* | |
| strings, boolean, floats -> 2/10 -> 0.004, 0.04498, 0.033444 (does not exist), integers (uint, int), address, arrays, mapping, structs, enums, bytes | |
| */ |
| // SPDX-License-Identifier: MIT | |
| pragma solidity ^0.8.0; | |
| import "contracts/1_Storage.sol"; | |
| contract Example { | |
| // DATA-TYPES | |
| /* | |
| strings, boolean, integers (uint8,16,24,32,40,48,56,64,72,80,88,96,104,...256, int8,int16...int256), bytes1,2,3,4,5,6...32 (value types) and then bytes(reference type), address, arrays, structs, enums, mappings | |
| uint8 - 2**8 -1 | |
| uint16 => 2**16 -1 |
| // SPDX-License-Identifier: MIT | |
| pragma solidity >=0.8.4; | |
| contract MyFirstContract{ | |
| // string, integers (uint, int), address | |
| address myAddress = 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4; | |
| uint number = 2024; | |
| int negativeNumber = -2024; | |
| string name = "Jesserc"; |
| func TestParseWithdrawalMessages(t *testing.T) { | |
| pool := mempool.New(testutils.NewMemDB(t)) | |
| // mempoolTxs := testapp.ToTxs(t, map[string]string{ | |
| // "k3": "v3", | |
| // "k4": "v4", | |
| // }) | |
| // for _, tx := range mempoolTxs { | |
| // require.NoError(t, pool.Enqueue(tx)) |
| package keeper | |
| import ( | |
| "math/big" | |
| sdkerrors "cosmossdk.io/errors" | |
| "cosmossdk.io/math" | |
| "github.com/cometbft/cometbft/libs/json" | |
| sdk "github.com/cosmos/cosmos-sdk/types" | |
| "github.com/cosmos/cosmos-sdk/types/errors" |