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
const API_BASE_URL = 'https://dev.alfafrens.com//api/trpc/'; | |
async function fetchFromAPI(endpoint, queryParams = {}) { | |
const url = new URL(`${API_BASE_URL}/${endpoint}`); | |
Object.keys(queryParams).forEach(key => url.searchParams.append(key, queryParams[key])); | |
try { | |
const response = await fetch(url, { method: 'GET', headers: { 'Content-Type': 'application/json' } }); | |
if (!response.ok) throw new Error('AlfaFrens is sick response was not ok'); | |
const jsonResponse = await response.json(); | |
return jsonResponse.result ? jsonResponse.result.data : null; |
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 { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; | |
import { Base64 } from "@openzeppelin/contracts/utils/Base64.sol"; | |
import {IConstantFlowAgreementV1} from "@superfluid-finance/ethereum-contracts/contracts/interfaces/agreements/IConstantFlowAgreementV1.sol"; | |
import { ISuperfluid, ISuperToken } from "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol"; | |
/* | |
Super721SVG - Generate NFT based on SF CFA Stream | |
*/ |
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 { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; | |
import { Counters } from "@openzeppelin/contracts/utils/Counters.sol"; | |
import {IConstantFlowAgreementV1} from "@superfluid-finance/ethereum-contracts/contracts/interfaces/agreements/IConstantFlowAgreementV1.sol"; | |
import { ISuperfluid, ISuperToken } from "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol"; | |
/* | |
Super721SVGOffchain - NFT that points to JSON Offchain | |
*/ |
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 { Strings } from "@openzeppelin/contracts/utils/Strings.sol"; | |
import { Base64 } from "@openzeppelin/contracts/utils/Base64.sol"; | |
import {IConstantFlowAgreementV1} from "@superfluid-finance/ethereum-contracts/contracts/interfaces/agreements/IConstantFlowAgreementV1.sol"; | |
import { ISuperfluid, ISuperToken } from "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol"; | |
/* | |
Super721SVGOnChain - Generate NFT based on SF CFA Stream | |
*/ |
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.8.10; | |
import "@openzeppelin/contracts/token/ERC721/ERC721.sol"; | |
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol"; | |
import "@openzeppelin/contracts/access/AccessControl.sol"; | |
import "@openzeppelin/contracts/utils/Counters.sol"; | |
contract SuperfluidETHAmsterdam22 is ERC721, ERC721URIStorage, AccessControl { | |
using Counters for Counters.Counter; |
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; | |
/* | |
We can pack all players permissions in one variable. Not using different maps for each one. | |
*/ | |
contract ExgrasiaPackPermissions { | |
//masks |
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 //0xECd2f5870c6D2EE5Dc4441B1887585A760E227fc | |
pragma solidity ^0.8.4; | |
import "./TinyWorld.sol"; | |
import "./TinyWorldRegistry.sol"; | |
import "./TileContract.sol"; | |
import "./Types.sol"; | |
import {CFAv1Library} from "https://github.com/superfluid-finance/protocol-monorepo/blob/dev/packages/ethereum-contracts/contracts/apps/CFAv1Library.sol"; |
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.8.13; | |
/* | |
Exemple of upgrader supertoken based on roles. | |
NOTICE: IS ONE EXAMPLE NOT PROD READY | |
*/ | |
import "@openzeppelin/contracts/access/AccessControlEnumerable.sol"; | |
import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; |
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.8.13; | |
/* | |
Factory that can deploy any number of TradeableCashflow using registerAppByFactory from SF protocol | |
*/ | |
import "./TradeableCashflow.sol"; | |
import {ISuperfluid, ISuperToken, SuperAppDefinitions} from "@superfluid-finance/ethereum-contracts/contracts/interfaces/superfluid/ISuperfluid.sol"; | |
contract TCFFactory { |
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.7.0 <0.9.0; | |
library SafeCast96 { | |
/** | |
* @dev Returns the downcasted int96 from uint256, reverting on | |
* overflow (when the input is less than smallest int96 or | |
* greater than largest int96). | |
* | |
* Counterpart to Solidity's `int96` operator. |
NewerOlder