This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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) { |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.0; | |
contract IntegerTest{ | |
uint a=15; | |
uint b=2; | |
function A() public view returns(uint){ | |
return a ** b; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.0; | |
contract boolean{ | |
uint x; | |
uint y; | |
bool z; | |
function Y()public { | |
x=200; | |
y=200; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.4.11; | |
contract modifysample { | |
uint a = 10; | |
modifier mf1 (uint b) { | |
uint c = b; | |
_; | |
c = a; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
pragma solidity ^0.5.0; | |
contract SimpleStorage { | |
uint storedData; | |
function set(uint x) public { | |
storedData = x; | |
} | |