๐
This file contains hidden or 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
curl https://testnet.bitfinity.network \ | |
-X POST -H 'content-Type: application/json' \ | |
-d '{"jsonrpc":"2.0","id":"67","method":"ic_mintNativeToken","params":["0x629A54Cb82f9A300a67bB77477D747a1F19815Cf", "0x100"]}' |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.19; | |
contract MoodDiary { | |
string mood; | |
function setMood(string memory _mood) public { | |
mood = _mood; | |
} |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.10; | |
contract Whitelist { | |
// ํ์ดํธ ๋ฆฌ์คํธ์ ๋ฑ๋ก๋ ์ฌ๋์ ๊ด๋ฆฌํ๋ ์ฉ๋์ map์์ฑ | |
// mapping ๋ณ์ ์ ์ธ | |
// ํ์ดํธ ๋ฆฌ์คํธ์ ํน์ ์ฃผ์๋ฅผ ๋ฑ๋ก์ํค๋ ํจ์ ์ ์ธ | |
} |
This file contains hidden or 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.8.0; | |
contract SimpleToken { | |
mapping(address => uint256) public balances; | |
// ํ ํฐ ์ ์ก ์ด๋ฒคํธ ์ ์ | |
event Transfer(address indexed _from, address indexed _to, uint256 _amount); | |
constructor(uint256 initialSupply) { | |
balances[msg.sender] = initialSupply; |
This file contains hidden or 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.8.0; | |
contract SimpleToken { | |
// state ๋ณ์๋ก ๊ฐ ์ฃผ์์ ์์ก์ ์ ์ฅ | |
mapping(address => uint256) public balances; | |
// ์ด๊ธฐ ์์ก ์ค์ | |
constructor(uint256 initialSupply) { | |
balances[msg.sender] = initialSupply; | |
} |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.10; | |
// ์ด๋ฒคํธ | |
// ๋ธ๋ก์ฒด์ธ์ ๋ก๊ทธ๋ฅผ ๋จ๊ธธ ๋ ์ฌ์ฉํ๋ ๋ฌธ๋ฒ(๊ฐ์ฒด)์ด๋ค. | |
// ํ๋ก ํธ์๋ ๋ฑ์์ ํน์ ์ปจํธ๋ํธ์ ๋ํ ๋ก๊ทธ๋ฅผ ํ์ฑํ์ฌ ์์ฉํ๋ ค ํ ๋ ์ ์ฉํ๋ค. | |
// ๋ธ๋ก์ฒด์ธ ์ํ๋ณ์๋ณด๋ค ๋ฎ์ ๋น์ฉ์ผ๋ก ์ ๋ณด๋ฅผ ์ ์ฅํ ์ ์๋ค. | |
contract Events { | |
// sender ์ฃผ์์ ๋ฉ์์ง์ ํด๋นํ๋ ๋ฌธ์์ด์ ๊ธฐ๋กํ ์ฉ๋์ ์ด๋ฒคํธ ์ ์ธ |
This file contains hidden or 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
// SPDX-License-Identifier: MIT | |
pragma solidity ^0.8.10; | |
// ๋งคํ(Mapping)์ ํด์๋งต, ๊ฐ์ฑ, ๋์ ๋๋ฆฌ์ฒ๋ผ ํค-๊ฐ ์์ด ์๋ ๋ฐ์ดํฐ๋ฅผ ์ ์ฅํ ๋ ์ฌ์ฉํ๋ค. | |
contract Mapping { | |
// ์ฃผ์(ํค)์ uint(๊ฐ)์์ ๋งคํํจ | |
mapping(address => uint) public myMap; | |
function get(address _addr) public view returns (uint) { | |
// ๋งคํ์ ํญ์ ๊ฐ์ ๋ฐํํ๋๋ฐ, |
This file contains hidden or 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
<html lang="en"> | |
<head> | |
<meta charset="UTF-8" /> | |
<meta http-equiv="X-UA-Compatible" content="IE=edge" /> | |
<meta name="viewport" content="width=device-width, initial-scale=1.0" /> | |
<title>My First dapp</title> | |
<script | |
src="https://cdn.ethers.io/lib/ethers-5.2.umd.min.js" | |
type="application/javascript" | |
></script> |
This file contains hidden or 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
// in util.js | |
export function times(x) { | |
return x * x; | |
} | |
export function plusTwo(number) { | |
return number + 2; | |
} | |
// in app.js | |
import { times as multiplication, plusTwo as plus2 } from './util.js'; |
This file contains hidden or 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
// in util.js | |
export default function times(x) { | |
return x * x; | |
} | |
// in app.js | |
import k from './util.js'; | |
console.log(k(4)); // returns 16 |