Skip to content

Instantly share code, notes, and snippets.

View jO-Osko's full-sized avatar

Filip Koprivec jO-Osko

View GitHub Profile
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.6 <0.9;
import {ContractRegistry} from "@flarenetwork/flare-periphery-contracts/coston2/ContractRegistry.sol";
import {FtsoV2Interface} from "@flarenetwork/flare-periphery-contracts/coston2/FtsoV2Interface.sol";
contract FtsoV2FeedConsumer {
FtsoV2Interface internal ftsoV2;
/**
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
enum A {
X,Y,Z
}
contract K {
}
@jO-Osko
jO-Osko / btc.json
Last active January 24, 2024 14:58
State connector response examples
{
"status": "VALID",
"response": {
"attestationType": "0x5061796d656e7400000000000000000000000000000000000000000000000000",
"sourceId": "0x7465737442544300000000000000000000000000000000000000000000000000",
"votingRound": "0",
"lowestUsedTimestamp": "1706098397",
"requestBody": {
"transactionId": "0x5035326fa81a2a7bd6761e59cf80da986d72ba955f58ad8a660c498898e992f7",
"inUtxo": "1",
@jO-Osko
jO-Osko / DynamicURIContract.sol
Created October 3, 2023 17:39
DynamicFlarePrice
// SPDX-License-Identifier: MIT
pragma solidity >=0.7.0 <0.9.0;
import { IPriceSubmitter } from "@flarenetwork/flare-periphery-contracts/flare/ftso/userInterfaces/IPriceSubmitter.sol";
import { IFtsoRegistry } from "@flarenetwork/flare-periphery-contracts/flare/ftso/userInterfaces/IFtsoRegistry.sol";
import { IFlareContractRegistry} from "@flarenetwork/flare-periphery-contracts/coston2/util-contracts/userInterfaces/IFlareContractRegistry.sol";
contract SimpleFtsoExample {

Navodila

Razdelite se v pare (dva človeka na računalnik) in skupaj rešujte naslednje naloge

# Naloge potrebujejo branje iz standardnega vhoda
# To nalažje simulirate tako
import sys

# Preden oddaate zakomentirajte spodnjo vrstico
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.6;
import { IFtso } from "@flarenetwork/flare-periphery-contracts/coston/ftso/userInterfaces/IFtso.sol";
import { IPriceSubmitter } from "@flarenetwork/flare-periphery-contracts/coston/ftso/userInterfaces/IPriceSubmitter.sol";
import { IFtsoRegistry } from "@flarenetwork/flare-periphery-contracts/coston/ftso/userInterfaces/IFtsoRegistry.sol";
contract SimpleFtsoExample {

Flare periphery package for smart contract development

This package contains a collection of smart contracts deployed on the Flare, Coston2 (test network for Flare), Songbird and Coston (test network for Songbird) networks.

The intention of this package is to provide a set of interfaces for easier integration and development of smart contracts on Flare based networks. Interfaces in the most recent version of this package are the same as the ones deployed on the networks. This package exposes all public and most of the internal interfaces but does not expose any of the implementations. If you want to access the implementations, you can use the official flare smart contracts repo.

The package functions similar to openzeppelin library packages and can easily be imported in nodejs based projects as well as directly in remix IDE.

Basic familiarity with the Flare network and EVM is assumed for use. For more information, please refer to

@jO-Osko
jO-Osko / imageproblems.ipynb
Created November 22, 2022 06:22
ImageProblems.ipynb
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import { IERC20Metadata } from "@openzeppelin/contracts/token/ERC20/extensions/IERC20Metadata.sol";
error InsufficientBalance(uint256 available, uint256 required);
contract Token is IERC20Metadata {
@jO-Osko
jO-Osko / AttackableNFTToken.sol
Last active December 26, 2022 22:42
Simple solidity contracts
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;
// WARNING: This contract is vulnerable to at least one type of commonly known attacks.
// Do not use this code in production.
import { ERC721Enumerable, ERC721 } from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import { IFtso } from "@flarenetwork/flare-periphery-contracts/coston/contracts/userInterfaces/IFtso.sol";
import { IPriceSubmitter } from "@flarenetwork/flare-periphery-contracts/coston/contracts/userInterfaces/IPriceSubmitter.sol";