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
curl -X POST --data '{ | |
"jsonrpc": "2.0", | |
"id": 3, | |
"method": "platform.createAddress", | |
"params": { | |
"username":"testuser_jp01", | |
"password":"<your user password>" | |
} | |
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/P | |
{"jsonrpc":"2.0","result":{"address":"P-fuji1s3056zrcm36y0pzx5d3g9p5quavvpxk2yhssvp"},"id":3 |
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
curl -X POST --data '{ | |
"jsonrpc":"2.0", | |
"id" :2, | |
"method" :"avm.createAddress", | |
"params" :{ | |
"username": "testuser_jp01", | |
"password": "<your user password>" | |
} | |
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/bc/X | |
{"jsonrpc":"2.0","result":{"address":"X-fuji14gnzvppj3ydjdkt49jdgrn67ha4fysk26jwm5g"},"id":2} |
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
curl -X POST --data '{ | |
"jsonrpc": "2.0", | |
"id": 1, | |
"method": "keystore.createUser", | |
"params": { | |
"username": "testuser_jp01", | |
"password": "<your user password>" | |
} | |
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/keystore | |
{"jsonrpc":"2.0","result":{"success":true},"id":1} |
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
curl -X POST --data '{ | |
"jsonrpc":"2.0", | |
"id" :1, | |
"method" :"info.isBootstrapped", | |
"params": { | |
"chain":"P" | |
} | |
}' -H 'content-type:application/json;' 127.0.0.1:9650/ext/info | |
{"jsonrpc":"2.0","result":{"isBootstrapped":true},"id":1} |
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
// SPDX-License-Identifier: mit | |
pragma solidity >= 0.6.2 < 0.8.0; | |
import "@openzeppelin/contracts/token/ERC20/ERC20.sol"; | |
contract CustomCoin is ERC20 { | |
string private TOKEN_NAME = "ERC20 Test Token"; | |
string private TOKEN_SYMBOL = "TEST"; | |
uint8 private constant TOKEN_DECIMALS = 18; |
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
function executeOperation( | |
uint256[] calldata _ids, | |
// uint256[] calldata _amounts, | |
address initiator, | |
bytes calldata params | |
) external override returns (bool) { | |
// obtain NCT of specific NFTs | |
NCT.claim(_ids); | |
// Sell it on uniswap |
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
INCT public constant NCT = INCT(0x8A9c4dfe8b9D8962B31e4e16F8321C44d48e246E); | |
IERC721 public constant HASHMASK = | |
IERC721(0xC2C747E0F7004F9E8817Db2ca4997657a7746928); | |
INFT20Pair public constant MASK20 = | |
INFT20Pair(0xc2BdE1A2fA26890c8E6AcB10C91CC6D9c11F4a73); | |
IUniswapV2Router public constant ROUTER_V2 = | |
IUniswapV2Router(0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D); | |
constructor() public { | |
// approve all deeds to MASK20 NFT pair contract |
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
function flashLoan( | |
uint256[] calldata _ids, | |
// uint256[] calldata _amounts, | |
address _operator, | |
bytes calldata _params | |
) external flashloansEnabled() { | |
require(_ids.length < 80, "To many NFTs"); | |
for (uint8 index; index < _ids.length; index++) { | |
IERC721(nftAddress).safeTransferFrom( |
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.8.0; | |
import "../interfaces/INFT20Pair.sol"; | |
contract HashMaskFlash is IFlashLoanReceiver, IERC721Receiver { | |
INFT20Pair public constant MASK20 = | |
INFT20Pair(0xc2BdE1A2fA26890c8E6AcB10C91CC6D9c11F4a73); | |
... | |
} |
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
// SPDX-License-Identifier: UNLICENSED | |
pragma solidity >=0.6.6 <0.8.0; | |
import './utils/SafeMath.sol'; | |
import './UniswapV2Library.sol'; | |
import './interfaces/IUniswapV2Router02.sol'; | |
import './interfaces/IUniswapV2Pair.sol'; | |
import './interfaces/IUniswapV2Factory.sol'; | |
import './interfaces/IERC20.sol'; |