Skip to content

Commit

Permalink
update solidity import patterns & compiled bytecode
Browse files Browse the repository at this point in the history
  • Loading branch information
sisyphusSmiling committed May 6, 2024
1 parent 5977bcf commit e3c90b5
Show file tree
Hide file tree
Showing 16 changed files with 74 additions and 43 deletions.
14 changes: 14 additions & 0 deletions cadence/args/deploy-erc20-deployer-args.json

Large diffs are not rendered by default.

14 changes: 14 additions & 0 deletions cadence/args/deploy-erc721-deployer-args.json

Large diffs are not rendered by default.

2 changes: 1 addition & 1 deletion cadence/args/deploy-factory-args.json

Large diffs are not rendered by default.

6 changes: 3 additions & 3 deletions cadence/tests/test_helpers.cdc

Large diffs are not rendered by default.

1 change: 0 additions & 1 deletion cadence/transactions/evm/create_account.cdc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ transaction(amount: UFix64) {
let coa <- EVM.createCadenceOwnedAccount()
coa.deposit(from: <-self.sentVault)

log(coa.balance().inFLOW())
let storagePath = StoragePath(identifier: "evm")!
let publicPath = PublicPath(identifier: "evm")!
self.auth.storage.save<@EVM.CadenceOwnedAccount>(<-coa, to: storagePath)
Expand Down
6 changes: 3 additions & 3 deletions solidity/src/FlowBridgeDeploymentRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "./interfaces/FlowEVMDeploymentRegistry.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {FlowEVMDeploymentRegistry} from "./interfaces/FlowEVMDeploymentRegistry.sol";

/**
* @title FlowBridgeDeploymentRegistry
Expand Down
7 changes: 6 additions & 1 deletion solidity/src/FlowBridgeFactory.sol
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ import {FlowEVMDeploymentRegistry} from "./interfaces/FlowEVMDeploymentRegistry.

/**
* @title FlowBridgeFactory
* @dev Factory contract to deploy new FlowEVM bridge contracts, defining Cadence-native assets in EVM
* @dev Factory contract to deploy new FlowEVM bridge contracts, defining Cadence-native assets in EVM. Cadence & EVM
* contract associations are maintained in a deployment registry. This factory is enabled to deploy contracts via
* registered deployer implementations, each of which handle the deployment of a single templated contract indexed by
* a human-readable deployer tag. This setup modularizes each key component of the EVM side of the Flow EVM VM bridge,
* allowing new asset types to be added by simply adding a new deployer implementation or updated factory contract
* to be swapped out without affecting the underlying associations between Cadence and EVM contracts.
*/
contract FlowBridgeFactory is Ownable {
// Address of the deployment registry where deployed contract associations are registered
Expand Down
12 changes: 6 additions & 6 deletions solidity/src/FlowEVMBridgedERC20Deployer.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "./interfaces/IFlowEVMBridgeDeployer.sol";
import "./templates/FlowEVMBridgedERC20.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {IFlowEVMBridgeDeployer} from "./interfaces/IFlowEVMBridgeDeployer.sol";
import {FlowEVMBridgedERC20} from "./templates/FlowEVMBridgedERC20.sol";

/**
* @title FlowEVMBridgedERC20Deployer
Expand All @@ -16,7 +16,7 @@ import "./templates/FlowEVMBridgedERC20.sol";
contract FlowEVMBridgedERC20Deployer is IFlowEVMBridgeDeployer, ERC165, Ownable {
// The address of the delegated deployer who can deploy new contracts
address public delegatedDeployer;

/**
* @dev Event emitted when a new ERC20 contract is deployed via this deployer
*/
Expand Down
12 changes: 6 additions & 6 deletions solidity/src/FlowEVMBridgedERC721Deployer.sol
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "./interfaces/IFlowEVMBridgeDeployer.sol";
import "./templates/FlowEVMBridgedERC721.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {IFlowEVMBridgeDeployer} from "./interfaces/IFlowEVMBridgeDeployer.sol";
import {FlowEVMBridgedERC721} from "./templates/FlowEVMBridgedERC721.sol";

/**
* @title FlowEVMBridgedERC721Deployer
Expand Down
6 changes: 3 additions & 3 deletions solidity/src/interfaces/BridgePermissions.sol
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "./IBridgePermissions.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {IBridgePermissions} from "./IBridgePermissions.sol";

/**
* @dev Contract for which implementation is checked by the Flow VM bridge as an opt-out mechanism
Expand Down
8 changes: 4 additions & 4 deletions solidity/src/interfaces/FlowEVMDeploymentRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "./IFlowEVMDeploymentRegistry.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {ERC165} from "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import {IFlowEVMDeploymentRegistry} from "./IFlowEVMDeploymentRegistry.sol";

/**
* @title FlowEVMDeploymentRegistry
Expand Down
7 changes: 3 additions & 4 deletions solidity/src/interfaces/IBridgePermissions.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,16 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";

interface IBridgePermissions is IERC165 {

/**
* @dev Emitted when the permissions for the contract are updated.
*/
event PermissionsUpdated(bool newPermissions);

/**
* @dev Returns true if the contract allows bridging of its assets.
*/
function allowsBridging() external view returns (bool);
}
}
2 changes: 1 addition & 1 deletion solidity/src/interfaces/IFlowEVMBridgeDeployer.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
* @title IFlowEVMBridgeDeployer
Expand Down
2 changes: 1 addition & 1 deletion solidity/src/interfaces/IFlowEVMDeploymentRegistry.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/utils/introspection/IERC165.sol";
import {IERC165} from "@openzeppelin/contracts/utils/introspection/IERC165.sol";

/**
* @title IFlowEVMDeploymentRegistry
Expand Down
8 changes: 4 additions & 4 deletions solidity/src/templates/FlowEVMBridgedERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@
// Compatible with OpenZeppelin Contracts ^5.0.0
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";
import {ERC20Burnable} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Burnable.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";
import {ERC20Permit} from "@openzeppelin/contracts/token/ERC20/extensions/ERC20Permit.sol";

contract FlowEVMBridgedERC20 is ERC20, ERC20Burnable, Ownable, ERC20Permit {
string public flowTokenAddress;
Expand Down
10 changes: 5 additions & 5 deletions solidity/src/templates/FlowEVMBridgedERC721.sol
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.17;

import "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import {ERC721} from "@openzeppelin/contracts/token/ERC721/ERC721.sol";
import {ERC721URIStorage} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721URIStorage.sol";
import {ERC721Enumerable} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Enumerable.sol";
import {ERC721Burnable} from "@openzeppelin/contracts/token/ERC721/extensions/ERC721Burnable.sol";
import {Ownable} from "@openzeppelin/contracts/access/Ownable.sol";

contract FlowEVMBridgedERC721 is ERC721, ERC721URIStorage, ERC721Burnable, ERC721Enumerable, Ownable {
string public flowNFTAddress;
Expand Down

0 comments on commit e3c90b5

Please sign in to comment.