Skip to content

Instantly share code, notes, and snippets.

@Rbchi
Rbchi / TypeID
Created February 28, 2020 08:59
#include "blockchain.h"
#include "ckb_syscalls.h"
#define INPUT_SIZE 128
#define SCRIPT_SIZE 32768
int main() {
uint64_t len = 0;
int ret = ckb_load_cell(NULL, &len, 0, 1, CKB_SOURCE_GROUP_OUTPUT);
if (ret != CKB_INDEX_OUT_OF_BOUND) {
pragma solidity ^0.5.0;
contract FixedsSizeByteTest{
bytes1 X = 0x78; // 0111 1000
bytes1 Y = 0x69; // 0110 1001
function Test1() public view returns(bytes1){
return X & Y;
// X=0111 1000
pragma solidity ^0.5.0;
contract IntegerTest{
uint a=15;
uint b=2;
function A() public view returns(uint){
return a ** b;
@Rbchi
Rbchi / Boolean.sol
Created February 12, 2019 07:48
關於solidity -->value type -->bool
pragma solidity ^0.5.0;
contract boolean{
uint x;
uint y;
bool z;
function Y()public {
x=200;
y=200;
@Rbchi
Rbchi / ModifierTest.sol
Created January 21, 2019 11:35
關於Function Modifier的順序
pragma solidity ^0.4.11;
contract modifysample {
uint a = 10;
modifier mf1 (uint b) {
uint c = b;
_;
c = a;
@Rbchi
Rbchi / Solidity Get&Set
Last active January 6, 2019 14:16
Solidty101:Day1
pragma solidity ^0.5.0;
contract SimpleStorage {
uint storedData;
function set(uint x) public {
storedData = x;
}