Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

chore: extract metadata #1

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
227 changes: 227 additions & 0 deletions metadata/FiatTokenProxy.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,227 @@
{
"compiler": {
"version": "0.6.12+commit.27d51765"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "implementationContract",
"type": "address"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "previousAdmin",
"type": "address"
},
{
"indexed": false,
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "AdminChanged",
"type": "event"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "address",
"name": "implementation",
"type": "address"
}
],
"name": "Upgraded",
"type": "event"
},
{
"stateMutability": "payable",
"type": "fallback"
},
{
"inputs": [],
"name": "admin",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newAdmin",
"type": "address"
}
],
"name": "changeAdmin",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "implementation",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
}
],
"name": "upgradeTo",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [
{
"internalType": "address",
"name": "newImplementation",
"type": "address"
},
{
"internalType": "bytes",
"name": "data",
"type": "bytes"
}
],
"name": "upgradeToAndCall",
"outputs": [],
"stateMutability": "payable",
"type": "function"
}
],
"devdoc": {
"details": "This contract proxies FiatToken calls and enables FiatToken upgrades",
"kind": "dev",
"methods": {
"admin()": {
"returns": {
"_0": "The address of the proxy admin."
}
},
"changeAdmin(address)": {
"details": "Changes the admin of the proxy. Only the current admin can call this function.",
"params": {
"newAdmin": "Address to transfer proxy administration to."
}
},
"implementation()": {
"returns": {
"_0": "The address of the implementation."
}
},
"upgradeTo(address)": {
"details": "Upgrade the backing implementation of the proxy. Only the admin can call this function.",
"params": {
"newImplementation": "Address of the new implementation."
}
},
"upgradeToAndCall(address,bytes)": {
"details": "Upgrade the backing implementation of the proxy and call a function on the new implementation. This is useful to initialize the proxied contract.",
"params": {
"data": "Data to send as msg.data in the low level call. It should include the signature and the parameters of the function to be called, as described in https://solidity.readthedocs.io/en/develop/abi-spec.html#function-selector-and-argument-encoding.",
"newImplementation": "Address of the new implementation."
}
}
},
"title": "FiatTokenProxy",
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/v1/FiatTokenProxy.sol": "FiatTokenProxy"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 10000000
},
"remappings": []
},
"sources": {
"@openzeppelin/contracts/utils/Address.sol": {
"keccak256": "0x28911e614500ae7c607a432a709d35da25f3bc5ddc8bd12b278b66358070c0ea",
"license": "MIT",
"urls": [
"bzz-raw://256c8c8af5eb072bc473226ab2b2187149b8fc04f5f4a4820db22527f5ce8e3c",
"dweb:/ipfs/QmRvi5BhnL7Rxf85KrJhwM6RRhukm4tzoctRdgQEheNyiN"
]
},
"contracts/upgradeability/AdminUpgradeabilityProxy.sol": {
"keccak256": "0x709d23a3d4b34a43861d099ec8c3f964c933f45bf30ee08c98a569433114c599",
"license": "Apache-2.0",
"urls": [
"bzz-raw://97ec753a4c2cf21c11daccde7727b3343bedfe985b7299ddb86b91b641c6bb8e",
"dweb:/ipfs/QmRerVbjv74Yx4Pa26am82cAMDyMXzka1oE9YnrQtGwkd7"
]
},
"contracts/upgradeability/Proxy.sol": {
"keccak256": "0x27eb2c0719a143aafc9f7f1fa39ef225baa0ad667bcd5f90cd1e4abcc89f4c20",
"license": "Apache-2.0",
"urls": [
"bzz-raw://90cc41dbda5503142c6742a0b88fac18b9738dab7fb47365f9dd004921c31357",
"dweb:/ipfs/QmUfVsoFGj4nKvEy5fx7yszqNbC9VXWWkfWfMBHcwouLqr"
]
},
"contracts/upgradeability/UpgradeabilityProxy.sol": {
"keccak256": "0xa7a9d804acfb476666548a05cd94ce8a5ffa6bd76b038cbc3f1683d6ac708c49",
"license": "Apache-2.0",
"urls": [
"bzz-raw://805cbc090ff93c9d6eb6348683c6d2cf5da46c2bca254fda8d87516d395f9299",
"dweb:/ipfs/Qmez8Q656MWiJwHw2t88X6bJwgbK2aUnnoqcj2FzyaWxdy"
]
},
"contracts/v1/FiatTokenProxy.sol": {
"keccak256": "0x30fc5a64a101f783b2c745624d4c77b03a8f6373315857dc637581a189963f74",
"license": "Apache-2.0",
"urls": [
"bzz-raw://f5de3f5569c8ac27ca793653613ca320c0ce77617510c31e7451d9b32f83ddb0",
"dweb:/ipfs/QmYQq9xh4jNwCH9KUDbWqttj5MWMfY2iAZRzrQf4cHh2nA"
]
}
},
"version": 1
}
1 change: 1 addition & 0 deletions metadata/FiatTokenV2_2.json

Large diffs are not rendered by default.

101 changes: 101 additions & 0 deletions metadata/SignatureChecker.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
{
"compiler": {
"version": "0.6.12+commit.27d51765"
},
"language": "Solidity",
"output": {
"abi": [
{
"inputs": [
{
"internalType": "address",
"name": "signer",
"type": "address"
},
{
"internalType": "bytes32",
"name": "digest",
"type": "bytes32"
},
{
"internalType": "bytes",
"name": "signature",
"type": "bytes"
}
],
"name": "isValidSignatureNow",
"outputs": [
{
"internalType": "bool",
"name": "",
"type": "bool"
}
],
"stateMutability": "view",
"type": "function"
}
],
"devdoc": {
"details": "Signature verification helper that can be used instead of `ECRecover.recover` to seamlessly support both ECDSA signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets. Adapted from https://github.com/OpenZeppelin/openzeppelin-contracts/blob/21bb89ef5bfc789b9333eb05e3ba2b7b284ac77c/contracts/utils/cryptography/SignatureChecker.sol",
"kind": "dev",
"methods": {
"isValidSignatureNow(address,bytes32,bytes)": {
"details": "Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECRecover.recover`.",
"params": {
"digest": "Keccak-256 hash digest of the signed message",
"signature": "Signature byte array associated with hash",
"signer": "Address of the claimed signer"
}
}
},
"version": 1
},
"userdoc": {
"kind": "user",
"methods": {},
"version": 1
}
},
"settings": {
"compilationTarget": {
"contracts/util/SignatureChecker.sol": "SignatureChecker"
},
"evmVersion": "istanbul",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 10000000
},
"remappings": []
},
"sources": {
"contracts/interface/IERC1271.sol": {
"keccak256": "0x8accb9f93dcd398e5c84cb80010de808cf5092cebfa823b3d7c4b8e5b2bcf672",
"license": "Apache-2.0",
"urls": [
"bzz-raw://5b695059d7f0ba51bf58a3713683a892051078fdaabf37bbb8673614542b3267",
"dweb:/ipfs/QmRQoDkk2serLRyjnKFD2ynXnu8b4JyAix9DnBcwkdyL9n"
]
},
"contracts/util/ECRecover.sol": {
"keccak256": "0xedf59af6c5998f9e4b0791cd79122a759a1d80a38453053df77838914dd1294d",
"license": "Apache-2.0",
"urls": [
"bzz-raw://318c71b3f57477e7178b1a9eef86176ead3876bc7e2c196c312b07e6e79dd8f0",
"dweb:/ipfs/Qmer6yrZ39T1XWRtwCgz6DJE1ojT2eRKihsFfZJHzfErFk"
]
},
"contracts/util/SignatureChecker.sol": {
"keccak256": "0x89181a5d7440ce21492c5023ab98357c76e3de81ffc376dfda3983997a70728a",
"license": "Apache-2.0",
"urls": [
"bzz-raw://8a9e3c2176362b727900c001dd6625fb2c12773475effdb4e24ff44ce56654e3",
"dweb:/ipfs/QmNsdopHx3ZN7iANvTVJ1wH49MogQEgsUqBBD44USqUQS9"
]
}
},
"version": 1
}
58 changes: 58 additions & 0 deletions scripts/hardhat/getMetadata.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
/**
* Copyright 2024 Circle Internet Financial, LTD. All rights reserved.
*
* SPDX-License-Identifier: Apache-2.0
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an "AS IS" BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/

import * as fs from "fs";

function main() {
const buildInfo = JSON.parse(
fs.readFileSync(
"./artifacts/hardhat/build-info/a581d1aa6c8ba09202e5526b98d24c3d.json",
"utf-8"
)
);

// FiatTokenProxy
let contractName = "FiatTokenProxy";
let metadata =
buildInfo.output.contracts[`contracts/v1/${contractName}.sol`][contractName]
.metadata;
fs.writeFileSync(`metadata/${contractName}.json`, metadata, {
flag: "w",
});

// FiatTokenV2_2
contractName = "FiatTokenV2_2";
metadata =
buildInfo.output.contracts[`contracts/v2/${contractName}.sol`][contractName]
.metadata;
fs.writeFileSync(`metadata/${contractName}.json`, metadata, {
flag: "w",
});

// SignatureChecker
contractName = "SignatureChecker";
metadata =
buildInfo.output.contracts[`contracts/util/${contractName}.sol`][
contractName
].metadata;
fs.writeFileSync(`metadata/${contractName}.json`, metadata, {
flag: "w",
});
}

main();