Skip to content

Commit

Permalink
fix: build dependency issues
Browse files Browse the repository at this point in the history
  • Loading branch information
Dean Amiel committed Sep 14, 2023
1 parent 6912e51 commit 3cfa0e7
Show file tree
Hide file tree
Showing 11 changed files with 36 additions and 29 deletions.
11 changes: 11 additions & 0 deletions examples/evm/nft-linker/IERC721MintableBurnable.sol
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
// SPDX-License-Identifier: MIT

pragma solidity ^0.8.0;

import { IERC721 } from '@openzeppelin/contracts/token/ERC721/IERC721.sol';

interface IERC721MintableBurnable is IERC721 {
function mint(address to, uint256 tokenId) external;

function burn(uint256 tokenId) external;
}
9 changes: 3 additions & 6 deletions examples/evm/nft-linker/NftLinker.sol
Original file line number Diff line number Diff line change
@@ -1,7 +1,8 @@
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;

import '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import { ERC721 } from '@openzeppelin/contracts/token/ERC721/ERC721.sol';
import { IERC721 } from '@openzeppelin/contracts/interfaces/IERC721.sol';
import { IERC20 } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IERC20.sol';
import { IAxelarGasService } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGasService.sol';
import { IAxelarGateway } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGateway.sol';
Expand All @@ -19,11 +20,7 @@ contract NftLinker is ERC721, AxelarExecutable, Upgradable {
string public chainName; //To check if we are the source chain.
IAxelarGasService public immutable gasService;

constructor(
address gateway_,
address gasReceiver_,
address owner_
) ERC721('Axelar NFT Linker', 'ANL') AxelarExecutable(gateway_) Upgradable(owner_) {
constructor(address gateway_, address gasReceiver_) ERC721('Axelar NFT Linker', 'ANL') AxelarExecutable(gateway_) {
gasService = IAxelarGasService(gasReceiver_);
}

Expand Down
4 changes: 2 additions & 2 deletions examples/evm/nft-linker/NftLinkerBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity ^0.8.0;
import { IAxelarGateway } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGateway.sol';
import { IAxelarGasService } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGasService.sol';
import { AxelarExecutable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/executable/AxelarExecutable.sol';
import { AddressToString, StringToAddress } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/AddressString.sol';
import { AddressToString, StringToAddress } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/AddressString.sol';
import { Upgradable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/upgradable/Upgradable.sol';

abstract contract NftLinkerBase is AxelarExecutable, Upgradable {
Expand All @@ -15,7 +15,7 @@ abstract contract NftLinkerBase is AxelarExecutable, Upgradable {
bytes32 internal constant CONTRACT_ID = keccak256('nft-linker');
IAxelarGasService public immutable gasService;

constructor(address gatewayAddress, address gasServiceAddress_, address owner_) AxelarExecutable(gatewayAddress) Upgradable(owner_) {
constructor(address gatewayAddress, address gasServiceAddress_) AxelarExecutable(gatewayAddress) Upgradable() {
gasService = IAxelarGasService(gasServiceAddress_);
}

Expand Down
7 changes: 3 additions & 4 deletions examples/evm/nft-linker/NftLinkerLockUnlock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.0;

import { IERC721 } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IERC721.sol';
import { IERC721 } from '@openzeppelin/contracts/interfaces/IERC721.sol';
import { NftLinkerBase } from './NftLinkerBase.sol';

contract NftLinkerLockUnlock is NftLinkerBase {
Expand All @@ -14,9 +14,8 @@ contract NftLinkerLockUnlock is NftLinkerBase {
constructor(
address gatewayAddress_,
address gasServiceAddress_,
address operatorAddress_,
address owner_
) NftLinkerBase(gatewayAddress_, gasServiceAddress_, owner_) {
address operatorAddress_
) NftLinkerBase(gatewayAddress_, gasServiceAddress_) {
operatorAddress = operatorAddress_;
}

Expand Down
7 changes: 3 additions & 4 deletions examples/evm/nft-linker/NftLinkerMintBurn.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.0;

import { IERC721MintableBurnable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IERC721MintableBurnable.sol';
import { IERC721MintableBurnable } from './IERC721MintableBurnable.sol';
import { NftLinkerBase } from './NftLinkerBase.sol';

contract NftLinkerMintBurn is NftLinkerBase {
Expand All @@ -14,9 +14,8 @@ contract NftLinkerMintBurn is NftLinkerBase {
constructor(
address gatewayAddress_,
address gasServiceAddress_,
address operatorAddress_,
address owner_
) NftLinkerBase(gatewayAddress_, gasServiceAddress_, owner_) {
address operatorAddress_
) NftLinkerBase(gatewayAddress_, gasServiceAddress_) {
operatorAddress = operatorAddress_;
}

Expand Down
2 changes: 1 addition & 1 deletion examples/evm/token-linker/TokenLinkerBase.sol
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ pragma solidity ^0.8.0;
import { IAxelarGateway } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGateway.sol';
import { IAxelarGasService } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IAxelarGasService.sol';
import { AxelarExecutable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/executable/AxelarExecutable.sol';
import { StringToAddress, AddressToString } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/AddressString.sol';
import { StringToAddress, AddressToString } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/AddressString.sol';
import { Upgradable } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/upgradable/Upgradable.sol';

abstract contract TokenLinkerBase is AxelarExecutable, Upgradable {
Expand Down
2 changes: 1 addition & 1 deletion examples/evm/token-linker/TokenLinkerLockUnlock.sol
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
pragma solidity ^0.8.0;

import { IERC20 } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/interfaces/IERC20.sol';
import { SafeTokenTransfer, SafeTokenTransferFrom } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/SafeTransfer.sol';
import { SafeTokenTransfer, SafeTokenTransferFrom } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/SafeTransfer.sol';
import { TokenLinkerBase } from './TokenLinkerBase.sol';

contract TokenLinkerLockUnlock is TokenLinkerBase {
Expand Down
2 changes: 1 addition & 1 deletion examples/evm/token-linker/TokenLinkerNative.sol
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

pragma solidity ^0.8.0;

import { SafeNativeTransfer } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/utils/SafeTransfer.sol';
import { SafeNativeTransfer } from '@axelar-network/axelar-gmp-sdk-solidity/contracts/libs/SafeTransfer.sol';
import { TokenLinkerBase } from './TokenLinkerBase.sol';

contract TokenLinkerNative is TokenLinkerBase {
Expand Down
10 changes: 5 additions & 5 deletions examples/tests/NftLinker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,17 +5,17 @@ const {
utils: { defaultAbiCoder, keccak256, id },
constants: { AddressZero },
} = require('ethers');
const { deployCreate3Upgradable } = require('../index.js');
const { deployCreate3Upgradable } = require('@axelar-network/axelar-gmp-sdk-solidity/index');
const { expect } = chai;
const { ethers } = require('hardhat');

const NftLinkerProxy = require('../artifacts/examples/evm/nft-linker/NftLinkerProxy.sol/NftLinkerProxy.json');
const NftLinkerLockUnlock = require('../artifacts/examples/evm/nft-linker/NftLinkerLockUnlock.sol/NftLinkerLockUnlock.json');
const NftLinkerMintBurn = require('../artifacts/examples/evm/nft-linker/NftLinkerMintBurn.sol/NftLinkerMintBurn.json');
const NftLinkerProxy = require('../../artifacts/examples/evm/nft-linker/NftLinkerProxy.sol/NftLinkerProxy.json');
const NftLinkerLockUnlock = require('../../artifacts/examples/evm/nft-linker/NftLinkerLockUnlock.sol/NftLinkerLockUnlock.json');
const NftLinkerMintBurn = require('../../artifacts/examples/evm/nft-linker/NftLinkerMintBurn.sol/NftLinkerMintBurn.json');

const getRandomID = () => id(Math.floor(Math.random() * 1e10).toString());

describe('NftLinker', () => {
describe.only('NftLinker', () => {
let gatewayFactory;
let gasServiceFactory;
let tokenFactory;
Expand Down
10 changes: 5 additions & 5 deletions examples/tests/TokenLinker.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@ const {
utils: { defaultAbiCoder, keccak256, id },
constants: { AddressZero },
} = require('ethers');
const { deployCreate3Upgradable } = require('../index.js');
const { deployCreate3Upgradable } = require('@axelar-network/axelar-gmp-sdk-solidity/index');

const { expect } = chai;
const { ethers } = require('hardhat');

const TokenLinkerProxy = require('../artifacts/examples/evm/token-linker/TokenLinkerProxy.sol/TokenLinkerProxy.json');
const TokenLinkerLockUnlock = require('../artifacts/examples/evm/token-linker/TokenLinkerLockUnlock.sol/TokenLinkerLockUnlock.json');
const TokenLinkerMintBurn = require('../artifacts/examples/evm/token-linker/TokenLinkerMintBurn.sol/TokenLinkerMintBurn.json');
const TokenLinkerNative = require('../artifacts/examples/evm/token-linker/TokenLinkerNative.sol/TokenLinkerNative.json');
const TokenLinkerProxy = require('../../artifacts/examples/evm/token-linker/TokenLinkerProxy.sol/TokenLinkerProxy.json');
const TokenLinkerLockUnlock = require('../../artifacts/examples/evm/token-linker/TokenLinkerLockUnlock.sol/TokenLinkerLockUnlock.json');
const TokenLinkerMintBurn = require('../../artifacts/examples/evm/token-linker/TokenLinkerMintBurn.sol/TokenLinkerMintBurn.json');
const TokenLinkerNative = require('../../artifacts/examples/evm/token-linker/TokenLinkerNative.sol/TokenLinkerNative.json');

const getRandomID = () => id(Math.floor(Math.random() * 1e10).toString());

Expand Down
1 change: 1 addition & 0 deletions hardhat.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,5 +31,6 @@ module.exports = {
paths: {
sources: './examples',
artifacts: './artifacts',
tests: './examples/tests',
},
};

0 comments on commit 3cfa0e7

Please sign in to comment.