Commit 2435bb6c authored by smartcontracts's avatar smartcontracts Committed by GitHub

feat(ctp): use solmate instead of oz (#2674)

Replaces OZ contracts with solmate, now that v7 is MIT licensed.
Co-authored-by: default avatarmergify[bot] <37929162+mergify[bot]@users.noreply.github.com>
parent 9a99e0ac
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9; pragma solidity ^0.8.9;
import { ERC20 } from "@openzeppelin/contracts/token/ERC20/ERC20.sol"; import { ERC20 } from "@rari-capital/solmate/src/tokens/ERC20.sol";
import { ERC721 } from "@openzeppelin/contracts/token/ERC721/ERC721.sol"; import { ERC721 } from "@rari-capital/solmate/src/tokens/ERC721.sol";
import { Transactor } from "./Transactor.sol"; import { Transactor } from "./Transactor.sol";
/** /**
......
// SPDX-License-Identifier: MIT // SPDX-License-Identifier: MIT
pragma solidity ^0.8.9; pragma solidity ^0.8.9;
import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol"; import { Owned } from "@rari-capital/solmate/src/auth/Owned.sol";
/** /**
* @title Transactor * @title Transactor
* @notice Transactor is a minimal contract that can send transactions. * @notice Transactor is a minimal contract that can send transactions.
*/ */
contract Transactor is Ownable { contract Transactor is Owned {
/** /**
* @param _owner Initial contract owner. * @param _owner Initial contract owner.
*/ */
constructor(address _owner) Ownable() { constructor(address _owner) Owned(_owner) {}
transferOwnership(_owner);
}
/** /**
* Sends a CALL to a target address. * Sends a CALL to a target address.
......
...@@ -80,7 +80,7 @@ describe('AssetReceiver', () => { ...@@ -80,7 +80,7 @@ describe('AssetReceiver', () => {
AssetReceiver.connect(signer2)['withdrawETH(address)']( AssetReceiver.connect(signer2)['withdrawETH(address)'](
signer2.address signer2.address
) )
).to.be.revertedWith('Ownable: caller is not the owner') ).to.be.revertedWith('UNAUTHORIZED')
}) })
}) })
}) })
...@@ -119,7 +119,7 @@ describe('AssetReceiver', () => { ...@@ -119,7 +119,7 @@ describe('AssetReceiver', () => {
DEFAULT_RECIPIENT, DEFAULT_RECIPIENT,
DEFAULT_AMOUNT DEFAULT_AMOUNT
) )
).to.be.revertedWith('Ownable: caller is not the owner') ).to.be.revertedWith('UNAUTHORIZED')
}) })
}) })
}) })
...@@ -156,7 +156,7 @@ describe('AssetReceiver', () => { ...@@ -156,7 +156,7 @@ describe('AssetReceiver', () => {
TestERC20.address, TestERC20.address,
DEFAULT_RECIPIENT DEFAULT_RECIPIENT
) )
).to.be.revertedWith('Ownable: caller is not the owner') ).to.be.revertedWith('UNAUTHORIZED')
}) })
}) })
}) })
...@@ -193,7 +193,7 @@ describe('AssetReceiver', () => { ...@@ -193,7 +193,7 @@ describe('AssetReceiver', () => {
AssetReceiver.connect(signer2)[ AssetReceiver.connect(signer2)[
'withdrawERC20(address,address,uint256)' 'withdrawERC20(address,address,uint256)'
](TestERC20.address, DEFAULT_RECIPIENT, DEFAULT_AMOUNT) ](TestERC20.address, DEFAULT_RECIPIENT, DEFAULT_AMOUNT)
).to.be.revertedWith('Ownable: caller is not the owner') ).to.be.revertedWith('UNAUTHORIZED')
}) })
}) })
}) })
...@@ -236,7 +236,7 @@ describe('AssetReceiver', () => { ...@@ -236,7 +236,7 @@ describe('AssetReceiver', () => {
DEFAULT_RECIPIENT, DEFAULT_RECIPIENT,
DEFAULT_TOKEN_ID DEFAULT_TOKEN_ID
) )
).to.be.revertedWith('Ownable: caller is not the owner') ).to.be.revertedWith('UNAUTHORIZED')
}) })
}) })
}) })
......
...@@ -74,7 +74,7 @@ describe('AssetReceiver', () => { ...@@ -74,7 +74,7 @@ describe('AssetReceiver', () => {
gasLimit: 2_000_000, gasLimit: 2_000_000,
} }
) )
).to.be.revertedWith('Ownable: caller is not the owner') ).to.be.revertedWith('UNAUTHORIZED')
}) })
}) })
}) })
...@@ -109,7 +109,7 @@ describe('AssetReceiver', () => { ...@@ -109,7 +109,7 @@ describe('AssetReceiver', () => {
gasLimit: 2_000_000, gasLimit: 2_000_000,
} }
) )
).to.be.revertedWith('Ownable: caller is not the owner') ).to.be.revertedWith('UNAUTHORIZED')
}) })
}) })
}) })
......
...@@ -96,7 +96,7 @@ describe('Drippie', () => { ...@@ -96,7 +96,7 @@ describe('Drippie', () => {
DEFAULT_DRIP_NAME, DEFAULT_DRIP_NAME,
DEFAULT_DRIP_CONFIG DEFAULT_DRIP_CONFIG
) )
).to.be.revertedWith('Ownable: caller is not the owner') ).to.be.revertedWith('UNAUTHORIZED')
}) })
}) })
}) })
...@@ -182,7 +182,7 @@ describe('Drippie', () => { ...@@ -182,7 +182,7 @@ describe('Drippie', () => {
it('should revert', async () => { it('should revert', async () => {
await expect( await expect(
Drippie.connect(signer2).status(DEFAULT_DRIP_NAME, 1) Drippie.connect(signer2).status(DEFAULT_DRIP_NAME, 1)
).to.be.revertedWith('Ownable: caller is not the owner') ).to.be.revertedWith('UNAUTHORIZED')
}) })
}) })
}) })
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment