Skip to content

Commit 375c4b3

Browse files
committed
upgraded bill broker testnet
1 parent 8968606 commit 375c4b3

File tree

6 files changed

+403
-8
lines changed

6 files changed

+403
-8
lines changed

spot-vaults/.openzeppelin/sepolia.json

Lines changed: 319 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -326,6 +326,325 @@
326326
},
327327
"namespaces": {}
328328
}
329+
},
330+
"7f703e4a10347cca6e80b8d427a010abcbb83e0b8f3039d52b3a4a4aae5948ff": {
331+
"address": "0x047b82a5D79d9DF62dE4f34CbaBa83F71848a6BF",
332+
"txHash": "0xda1e4afb92b889dce9982b6ff84671a677d7735194299577ca14e1d7a3091cce",
333+
"layout": {
334+
"solcVersion": "0.8.24",
335+
"storage": [
336+
{
337+
"label": "_initialized",
338+
"offset": 0,
339+
"slot": "0",
340+
"type": "t_uint8",
341+
"contract": "Initializable",
342+
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:63",
343+
"retypedFrom": "bool"
344+
},
345+
{
346+
"label": "_initializing",
347+
"offset": 1,
348+
"slot": "0",
349+
"type": "t_bool",
350+
"contract": "Initializable",
351+
"src": "@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol:68"
352+
},
353+
{
354+
"label": "__gap",
355+
"offset": 0,
356+
"slot": "1",
357+
"type": "t_array(t_uint256)50_storage",
358+
"contract": "ContextUpgradeable",
359+
"src": "@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol:40"
360+
},
361+
{
362+
"label": "_balances",
363+
"offset": 0,
364+
"slot": "51",
365+
"type": "t_mapping(t_address,t_uint256)",
366+
"contract": "ERC20Upgradeable",
367+
"src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:40"
368+
},
369+
{
370+
"label": "_allowances",
371+
"offset": 0,
372+
"slot": "52",
373+
"type": "t_mapping(t_address,t_mapping(t_address,t_uint256))",
374+
"contract": "ERC20Upgradeable",
375+
"src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:42"
376+
},
377+
{
378+
"label": "_totalSupply",
379+
"offset": 0,
380+
"slot": "53",
381+
"type": "t_uint256",
382+
"contract": "ERC20Upgradeable",
383+
"src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:44"
384+
},
385+
{
386+
"label": "_name",
387+
"offset": 0,
388+
"slot": "54",
389+
"type": "t_string_storage",
390+
"contract": "ERC20Upgradeable",
391+
"src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:46"
392+
},
393+
{
394+
"label": "_symbol",
395+
"offset": 0,
396+
"slot": "55",
397+
"type": "t_string_storage",
398+
"contract": "ERC20Upgradeable",
399+
"src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:47"
400+
},
401+
{
402+
"label": "__gap",
403+
"offset": 0,
404+
"slot": "56",
405+
"type": "t_array(t_uint256)45_storage",
406+
"contract": "ERC20Upgradeable",
407+
"src": "@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol:376"
408+
},
409+
{
410+
"label": "__gap",
411+
"offset": 0,
412+
"slot": "101",
413+
"type": "t_array(t_uint256)50_storage",
414+
"contract": "ERC20BurnableUpgradeable",
415+
"src": "@openzeppelin/contracts-upgradeable/token/ERC20/extensions/ERC20BurnableUpgradeable.sol:51"
416+
},
417+
{
418+
"label": "_owner",
419+
"offset": 0,
420+
"slot": "151",
421+
"type": "t_address",
422+
"contract": "OwnableUpgradeable",
423+
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:22"
424+
},
425+
{
426+
"label": "__gap",
427+
"offset": 0,
428+
"slot": "152",
429+
"type": "t_array(t_uint256)49_storage",
430+
"contract": "OwnableUpgradeable",
431+
"src": "@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol:94"
432+
},
433+
{
434+
"label": "_paused",
435+
"offset": 0,
436+
"slot": "201",
437+
"type": "t_bool",
438+
"contract": "PausableUpgradeable",
439+
"src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:29"
440+
},
441+
{
442+
"label": "__gap",
443+
"offset": 0,
444+
"slot": "202",
445+
"type": "t_array(t_uint256)49_storage",
446+
"contract": "PausableUpgradeable",
447+
"src": "@openzeppelin/contracts-upgradeable/security/PausableUpgradeable.sol:116"
448+
},
449+
{
450+
"label": "_status",
451+
"offset": 0,
452+
"slot": "251",
453+
"type": "t_uint256",
454+
"contract": "ReentrancyGuardUpgradeable",
455+
"src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:38"
456+
},
457+
{
458+
"label": "__gap",
459+
"offset": 0,
460+
"slot": "252",
461+
"type": "t_array(t_uint256)49_storage",
462+
"contract": "ReentrancyGuardUpgradeable",
463+
"src": "@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol:88"
464+
},
465+
{
466+
"label": "perp",
467+
"offset": 0,
468+
"slot": "301",
469+
"type": "t_contract(IPerpetualTranche)2878",
470+
"contract": "BillBroker",
471+
"src": "contracts/BillBroker.sol:94"
472+
},
473+
{
474+
"label": "usd",
475+
"offset": 0,
476+
"slot": "302",
477+
"type": "t_contract(IERC20Upgradeable)5020",
478+
"contract": "BillBroker",
479+
"src": "contracts/BillBroker.sol:97"
480+
},
481+
{
482+
"label": "usdUnitAmt",
483+
"offset": 0,
484+
"slot": "303",
485+
"type": "t_uint256",
486+
"contract": "BillBroker",
487+
"src": "contracts/BillBroker.sol:100"
488+
},
489+
{
490+
"label": "perpUnitAmt",
491+
"offset": 0,
492+
"slot": "304",
493+
"type": "t_uint256",
494+
"contract": "BillBroker",
495+
"src": "contracts/BillBroker.sol:103"
496+
},
497+
{
498+
"label": "keeper",
499+
"offset": 0,
500+
"slot": "305",
501+
"type": "t_address",
502+
"contract": "BillBroker",
503+
"src": "contracts/BillBroker.sol:108"
504+
},
505+
{
506+
"label": "oracle",
507+
"offset": 0,
508+
"slot": "306",
509+
"type": "t_contract(IPerpPricer)13600",
510+
"contract": "BillBroker",
511+
"src": "contracts/BillBroker.sol:111"
512+
},
513+
{
514+
"label": "fees",
515+
"offset": 0,
516+
"slot": "307",
517+
"type": "t_struct(BillBrokerFees)13657_storage",
518+
"contract": "BillBroker",
519+
"src": "contracts/BillBroker.sol:114"
520+
},
521+
{
522+
"label": "arHardBound",
523+
"offset": 0,
524+
"slot": "314",
525+
"type": "t_struct(Range)13689_storage",
526+
"contract": "BillBroker",
527+
"src": "contracts/BillBroker.sol:117"
528+
},
529+
{
530+
"label": "arSoftBound",
531+
"offset": 0,
532+
"slot": "316",
533+
"type": "t_struct(Range)13689_storage",
534+
"contract": "BillBroker",
535+
"src": "contracts/BillBroker.sol:121"
536+
}
537+
],
538+
"types": {
539+
"t_address": {
540+
"label": "address",
541+
"numberOfBytes": "20"
542+
},
543+
"t_array(t_uint256)45_storage": {
544+
"label": "uint256[45]",
545+
"numberOfBytes": "1440"
546+
},
547+
"t_array(t_uint256)49_storage": {
548+
"label": "uint256[49]",
549+
"numberOfBytes": "1568"
550+
},
551+
"t_array(t_uint256)50_storage": {
552+
"label": "uint256[50]",
553+
"numberOfBytes": "1600"
554+
},
555+
"t_bool": {
556+
"label": "bool",
557+
"numberOfBytes": "1"
558+
},
559+
"t_contract(IERC20Upgradeable)5020": {
560+
"label": "contract IERC20Upgradeable",
561+
"numberOfBytes": "20"
562+
},
563+
"t_contract(IPerpPricer)13600": {
564+
"label": "contract IPerpPricer",
565+
"numberOfBytes": "20"
566+
},
567+
"t_contract(IPerpetualTranche)2878": {
568+
"label": "contract IPerpetualTranche",
569+
"numberOfBytes": "20"
570+
},
571+
"t_mapping(t_address,t_mapping(t_address,t_uint256))": {
572+
"label": "mapping(address => mapping(address => uint256))",
573+
"numberOfBytes": "32"
574+
},
575+
"t_mapping(t_address,t_uint256)": {
576+
"label": "mapping(address => uint256)",
577+
"numberOfBytes": "32"
578+
},
579+
"t_string_storage": {
580+
"label": "string",
581+
"numberOfBytes": "32"
582+
},
583+
"t_struct(BillBrokerFees)13657_storage": {
584+
"label": "struct BillBrokerFees",
585+
"members": [
586+
{
587+
"label": "mintFeePerc",
588+
"type": "t_uint256",
589+
"offset": 0,
590+
"slot": "0"
591+
},
592+
{
593+
"label": "burnFeePerc",
594+
"type": "t_uint256",
595+
"offset": 0,
596+
"slot": "1"
597+
},
598+
{
599+
"label": "perpToUSDSwapFeeFactors",
600+
"type": "t_struct(Range)13689_storage",
601+
"offset": 0,
602+
"slot": "2"
603+
},
604+
{
605+
"label": "usdToPerpSwapFeeFactors",
606+
"type": "t_struct(Range)13689_storage",
607+
"offset": 0,
608+
"slot": "4"
609+
},
610+
{
611+
"label": "protocolSwapSharePerc",
612+
"type": "t_uint256",
613+
"offset": 0,
614+
"slot": "6"
615+
}
616+
],
617+
"numberOfBytes": "224"
618+
},
619+
"t_struct(Range)13689_storage": {
620+
"label": "struct Range",
621+
"members": [
622+
{
623+
"label": "lower",
624+
"type": "t_uint256",
625+
"offset": 0,
626+
"slot": "0"
627+
},
628+
{
629+
"label": "upper",
630+
"type": "t_uint256",
631+
"offset": 0,
632+
"slot": "1"
633+
}
634+
],
635+
"numberOfBytes": "64"
636+
},
637+
"t_uint256": {
638+
"label": "uint256",
639+
"numberOfBytes": "32"
640+
},
641+
"t_uint8": {
642+
"label": "uint8",
643+
"numberOfBytes": "1"
644+
}
645+
},
646+
"namespaces": {}
647+
}
329648
}
330649
}
331650
}

spot-vaults/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ The official mainnet addresses are:
1212
The official testnet addresses are:
1313

1414
- Bill Broker (SPOT-USDC): [0xc3f6D1F1d253EdC8B34D78Bc6cDD2b3eEFAd76BD](https://sepolia.etherscan.io/address/0xc3f6D1F1d253EdC8B34D78Bc6cDD2b3eEFAd76BD)
15-
- SpotAppraiser **(deprecated)**: [0x08c5b39F000705ebeC8427C1d64D6262392944EE](https://sepolia.etherscan.io/address/0x08c5b39F000705ebeC8427C1d64D6262392944EE)
15+
- SpotPricer: [0xc3B2C246b61123E7d18dc8d831A8314Eb038beE5](https://sepolia.etherscan.io/address/0xc3B2C246b61123E7d18dc8d831A8314Eb038beE5)
1616

1717
## Install
1818

Lines changed: 47 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,47 @@
1+
// SPDX-License-Identifier: BUSL-1.1
2+
pragma solidity ^0.8.24;
3+
4+
import { Math } from "@openzeppelin/contracts/utils/math/Math.sol";
5+
import { IERC20 } from "../_interfaces/external/IERC20.sol";
6+
import { IPerpetualTranche } from "../_interfaces/external/IPerpetualTranche.sol";
7+
import { IAMPL } from "../_interfaces/external/IAMPL.sol";
8+
import { IAmpleforth } from "../_interfaces/external/IAmpleforth.sol";
9+
10+
/**
11+
* @title MockSpotPricer
12+
*
13+
* @notice SpotPricer for bill broker testnet deployment.
14+
*
15+
*/
16+
contract MockSpotPricer {
17+
using Math for uint256;
18+
uint256 private constant DECIMALS = 18;
19+
uint256 private constant ONE = (10 ** DECIMALS);
20+
21+
IPerpetualTranche public immutable SPOT;
22+
23+
constructor(IPerpetualTranche spot) {
24+
SPOT = spot;
25+
}
26+
27+
function decimals() external pure returns (uint8) {
28+
return uint8(DECIMALS);
29+
}
30+
31+
function usdPrice() external pure returns (uint256, bool) {
32+
return (ONE, true);
33+
}
34+
35+
function perpUsdPrice() external returns (uint256, bool) {
36+
return perpFmvUsdPrice();
37+
}
38+
39+
function perpFmvUsdPrice() public returns (uint256, bool) {
40+
(uint256 targetPrice, bool targetPriceValid) = amplTargetUsdPrice();
41+
return (targetPrice.mulDiv(SPOT.getTVL(), SPOT.totalSupply()), targetPriceValid);
42+
}
43+
44+
function amplTargetUsdPrice() public pure returns (uint256, bool) {
45+
return (ONE.mulDiv(121, 100), true);
46+
}
47+
}

0 commit comments

Comments
 (0)