Skip to content

Commit

Permalink
Update meta-txs example to latest contracts version
Browse files Browse the repository at this point in the history
  • Loading branch information
spalladino committed Jan 10, 2022
1 parent 190a4e8 commit a5901ee
Show file tree
Hide file tree
Showing 5 changed files with 16 additions and 11 deletions.
8 changes: 4 additions & 4 deletions 01-defender-meta-txs/contracts/Registry.sol
Original file line number Diff line number Diff line change
@@ -1,17 +1,17 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import "openzeppelin-solidity/contracts/metatx/BaseRelayRecipient.sol";
import "openzeppelin-solidity/contracts/metatx/MinimalForwarder.sol";
import "@openzeppelin/contracts/metatx/ERC2771Context.sol";
import "@openzeppelin/contracts/metatx/MinimalForwarder.sol";

contract Registry is BaseRelayRecipient {
contract Registry is ERC2771Context {
event Registered(address indexed who, string name);

mapping(address => string) public names;
mapping(string => address) public owners;

constructor(MinimalForwarder forwarder) // Initialize trusted forwarder
BaseRelayRecipient(address(forwarder)) {
ERC2771Context(address(forwarder)) {
}

function register(string memory name) external {
Expand Down
4 changes: 2 additions & 2 deletions 01-defender-meta-txs/deploy.json
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
{
"MinimalForwarder": "0xB2819af7aAa8E7394D2303F2aB3C731c36072Fd3",
"Registry": "0x54189C6F7e3EEBA3d988A047934bE3365B38A011"
"MinimalForwarder": "0x1A8f6185Df1d2861d3012328Eb923e35Ca98Efed",
"Registry": "0xC851CC8bf0ED0E5B3A7247b750451E9b75dd5f3A"
}
4 changes: 4 additions & 0 deletions 01-defender-meta-txs/hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,10 @@ module.exports = {
xdai: {
url: 'https://dai.poa.network',
accounts: [process.env.PRIVATE_KEY],
},
mumbai: {
url: 'https://matic-mumbai.chainstacklabs.com',
accounts: [process.env.PRIVATE_KEY],
}
}
};
2 changes: 1 addition & 1 deletion 01-defender-meta-txs/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@
"devDependencies": {
"@nomiclabs/hardhat-ethers": "^2.0.1",
"@nomiclabs/hardhat-waffle": "^2.0.1",
"@openzeppelin/contracts": "^4.4.1",
"@rollup/plugin-commonjs": "^17.1.0",
"@rollup/plugin-json": "^4.1.0",
"@rollup/plugin-node-resolve": "^11.1.1",
Expand All @@ -34,7 +35,6 @@
"ethereum-waffle": "^3.2.2",
"ethers": "^5.0.30",
"hardhat": "^2.0.8",
"openzeppelin-solidity": "Amxx/openzeppelin-contracts#0abb2530ecd8dbfde32551cb22d1db6a054dfe64",
"rollup": "^2.38.5"
},
"dependencies": {
Expand Down
9 changes: 5 additions & 4 deletions 01-defender-meta-txs/yarn.lock
Original file line number Diff line number Diff line change
Expand Up @@ -453,6 +453,11 @@
"@types/sinon-chai" "^3.2.3"
"@types/web3" "1.0.19"

"@openzeppelin/contracts@^4.4.1":
version "4.4.1"
resolved "https://registry.yarnpkg.com/@openzeppelin/contracts/-/contracts-4.4.1.tgz#3382db2cd83ab565ed9626765e7da92944b45de8"
integrity sha512-o+pHCf/yMLSlV5MkDQEzEQL402i6SoRnktru+0rdSxVEFZcTzzGhZCAtZjUFyKGazMSv1TilzMg+RbED1N8XHQ==

"@resolver-engine/core@^0.3.3":
version "0.3.3"
resolved "https://registry.yarnpkg.com/@resolver-engine/core/-/core-0.3.3.tgz#590f77d85d45bc7ecc4e06c654f41345db6ca967"
Expand Down Expand Up @@ -5434,10 +5439,6 @@ once@^1.3.0, once@^1.3.1, once@^1.3.3, once@^1.4.0:
dependencies:
wrappy "1"

openzeppelin-solidity@Amxx/openzeppelin-contracts#0abb2530ecd8dbfde32551cb22d1db6a054dfe64:
version "3.4.0"
resolved "https://codeload.github.com/Amxx/openzeppelin-contracts/tar.gz/0abb2530ecd8dbfde32551cb22d1db6a054dfe64"

os-homedir@^1.0.0:
version "1.0.2"
resolved "https://registry.yarnpkg.com/os-homedir/-/os-homedir-1.0.2.tgz#ffbc4988336e0e833de0c168c7ef152121aa7fb3"
Expand Down

0 comments on commit a5901ee

Please sign in to comment.