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
// hardhat ignition module | |
// filepath: ignition/modules/MyNFT.js | |
const { buildModule } = require("@nomicfoundation/hardhat-ignition/modules"); | |
module.exports = buildModule("MyNFTModule", (m) => { | |
const token = m.contract("MyNFT", [], {}); | |
return { token }; | |
}); |
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: GPL-3.0 | |
pragma solidity >=0.8.2 <0.9.0; | |
struct Hashtable { | |
mapping(address => uint) valueMap; | |
address[] keys; | |
} | |
function put(Hashtable storage self, address key, uint value) returns(bool) { | |
if(self.valueMap[key] != 0) { |
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: GPL-3.0 | |
pragma solidity >=0.8.2 <0.9.0; | |
contract Storage { | |
uint256 number; | |
function store(uint256 num) public { | |
number = num; | |
} |
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.9.0; | |
/** | |
* @title Storage | |
* @dev Store & retrieve value in a variable | |
* @custom:dev-run-script ./scripts/deploy_with_ethers.ts | |
*/ | |
contract BitShiftTest { | |
uint256 number; |
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: GPL-3.0 | |
pragma solidity >=0.7.0 <0.9.0; | |
/** | |
* @title FlashTransfer | |
* @dev Simple blind transfer contract | |
*/ | |
contract BlindTransfer { | |
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
import React from 'react'; | |
import './App.css'; | |
import './ExchangeRates' | |
import ExchangeRates from "./ExchangeRates"; | |
export default function App() { | |
return ( | |
<div> | |
<h2>My first Apollo app 🚀</h2> |
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
import React from 'react'; | |
import ReactDOM from 'react-dom'; | |
import './index.css'; | |
import App from './App'; | |
import reportWebVitals from './reportWebVitals'; | |
import fetch from 'cross-fetch'; | |
import { gql, ApolloProvider, ApolloClient, HttpLink, InMemoryCache } from '@apollo/client'; | |
const endpoint = 'https://48p1r2roz4.sse.codesandbox.io' // apolloのGetting Started |
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
import {gql, useQuery} from '@apollo/client'; | |
const EXCHANGE_RATES = gql` | |
query GetExchangeRates { | |
rates(currency: "USD") { | |
currency | |
rate | |
} | |
} | |
`; |
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
import fetch from 'cross-fetch'; | |
import { gql, ApolloClient, HttpLink, InMemoryCache } from '@apollo/client'; | |
const client = new ApolloClient({ | |
link: new HttpLink({ uri: 'https://48p1r2roz4.sse.codesandbox.io', fetch }), | |
cache: new InMemoryCache() | |
}); | |
client | |
.query({ | |
query: gql` | |
query GetRates { |
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.1; | |
contract ModExpContracts { | |
address public constant modExpAddress = 0x0000000000000000000000000000000000000005; | |
bytes public _result; | |
function modExp( | |
uint baseLength, |
NewerOlder