Commit a92e4c3f authored by elenadimitrova's avatar elenadimitrova Committed by Kelvin Fichter

Removing generic OVM prefixes

parent f5a3cfd8
......@@ -13,7 +13,7 @@ export const initWatcher = async (
AddressManager: Contract
) => {
const l1MessengerAddress = await AddressManager.getAddress(
'Proxy__OVM_L1CrossDomainMessenger'
'Proxy__L1CrossDomainMessenger'
)
const l2MessengerAddress = await AddressManager.getAddress(
'L2CrossDomainMessenger'
......
......@@ -29,7 +29,7 @@ if [ $L1_STANDARD_BRIDGE_ADDRESS == null ]; then
envSet L1_STANDARD_BRIDGE_ADDRESS L1StandardBridge
fi
envSet L1_CROSS_DOMAIN_MESSENGER_ADDRESS Proxy__OVM_L1CrossDomainMessenger
envSet L1_CROSS_DOMAIN_MESSENGER_ADDRESS Proxy__L1CrossDomainMessenger
if [ $L1_CROSS_DOMAIN_MESSENGER_ADDRESS == null ]; then
envSet L1_CROSS_DOMAIN_MESSENGER_ADDRESS L1CrossDomainMessenger
fi
......
......@@ -88,7 +88,7 @@ describe('BatchSubmitter', () => {
let AddressManager: Contract
let Mock__OVM_ExecutionManager: MockContract
let Mock__OVM_BondManager: MockContract
let Mock__BondManager: MockContract
let Mock__StateCommitmentChain: MockContract
before(async () => {
AddressManager = await makeAddressManager()
......@@ -101,8 +101,8 @@ describe('BatchSubmitter', () => {
await getContractFactory('OVM_ExecutionManager')
)
Mock__OVM_BondManager = await smockit(
await getContractFactory('OVM_BondManager')
Mock__BondManager = await smockit(
await getContractFactory('BondManager')
)
Mock__StateCommitmentChain = await smockit(
......@@ -117,8 +117,8 @@ describe('BatchSubmitter', () => {
await setProxyTarget(
AddressManager,
'OVM_BondManager',
Mock__OVM_BondManager
'BondManager',
Mock__BondManager
)
await setProxyTarget(
......@@ -131,7 +131,7 @@ describe('BatchSubmitter', () => {
Mock__OVM_ExecutionManager.smocked.getMaxTransactionGasLimit.will.return.with(
MAX_GAS_LIMIT
)
Mock__OVM_BondManager.smocked.isCollateralized.will.return.with(true)
Mock__BondManager.smocked.isCollateralized.will.return.with(true)
})
let Factory__CanonicalTransactionChain: ContractFactory
......
......@@ -16,7 +16,7 @@ const deployFn: DeployFunction = async (hre) => {
}
)
const result = await deploy('Proxy__OVM_L1CrossDomainMessenger', {
const result = await deploy('Proxy__L1CrossDomainMessenger', {
contract: 'Lib_ResolvedDelegateProxy',
from: deployer,
args: [Lib_AddressManager.address, 'L1CrossDomainMessenger'],
......@@ -27,23 +27,23 @@ const deployFn: DeployFunction = async (hre) => {
return
}
const Proxy__OVM_L1CrossDomainMessenger = await getDeployedContract(
const Proxy__L1CrossDomainMessenger = await getDeployedContract(
hre,
'Proxy__OVM_L1CrossDomainMessenger',
'Proxy__L1CrossDomainMessenger',
{
signerOrProvider: deployer,
iface: 'L1CrossDomainMessenger',
}
)
await Proxy__OVM_L1CrossDomainMessenger.initialize(Lib_AddressManager.address)
await Proxy__L1CrossDomainMessenger.initialize(Lib_AddressManager.address)
const libAddressManager =
await Proxy__OVM_L1CrossDomainMessenger.libAddressManager()
await Proxy__L1CrossDomainMessenger.libAddressManager()
if (libAddressManager !== Lib_AddressManager.address) {
throw new Error(
`\n**FATAL ERROR. THIS SHOULD NEVER HAPPEN. CHECK YOUR DEPLOYMENT.**:\n` +
`Proxy__OVM_L1CrossDomainMessenger could not be succesfully initialized.\n` +
`Proxy__L1CrossDomainMessenger could not be succesfully initialized.\n` +
`Attempted to set Lib_AddressManager to: ${Lib_AddressManager.address}\n` +
`Actual address after initialization: ${libAddressManager}\n` +
`This could indicate a compromised deployment.`
......@@ -51,12 +51,12 @@ const deployFn: DeployFunction = async (hre) => {
}
await Lib_AddressManager.setAddress(
'Proxy__OVM_L1CrossDomainMessenger',
'Proxy__L1CrossDomainMessenger',
result.address
)
}
deployFn.dependencies = ['Lib_AddressManager', 'L1CrossDomainMessenger']
deployFn.tags = ['Proxy__OVM_L1CrossDomainMessenger']
deployFn.tags = ['Proxy__L1CrossDomainMessenger']
export default deployFn
......@@ -58,7 +58,7 @@ const deployFn: DeployFunction = async (hre) => {
// Set slot 0 to the L1 Messenger Address
const l1MessengerAddress = await Lib_AddressManager.getAddress(
'Proxy__OVM_L1CrossDomainMessenger'
'Proxy__L1CrossDomainMessenger'
)
await Proxy__WithChugSplashInterface.setStorage(
hre.ethers.constants.HashZero,
......
......@@ -67,7 +67,7 @@ export const connectL1Contracts = async (
),
stateCommitmentChain: getEthersContract('StateCommitmentChain'),
xDomainMessengerProxy: getEthersContract(
'Proxy__OVM_L1CrossDomainMessenger'
'Proxy__L1CrossDomainMessenger'
),
bondManager: getEthersContract('mockBondManager'),
}
......
......@@ -57,7 +57,7 @@ describe('L1CrossDomainMessenger', () => {
let Factory__CanonicalTransactionChain: ContractFactory
let Factory__ChainStorageContainer: ContractFactory
let Factory__OVM_L1CrossDomainMessenger: ContractFactory
let Factory__L1CrossDomainMessenger: ContractFactory
let CanonicalTransactionChain: Contract
before(async () => {
......@@ -93,7 +93,7 @@ describe('L1CrossDomainMessenger', () => {
'ChainStorageContainer'
)
Factory__OVM_L1CrossDomainMessenger = await ethers.getContractFactory(
Factory__L1CrossDomainMessenger = await ethers.getContractFactory(
'L1CrossDomainMessenger'
)
CanonicalTransactionChain =
......@@ -132,7 +132,7 @@ describe('L1CrossDomainMessenger', () => {
let L1CrossDomainMessenger: Contract
beforeEach(async () => {
const xDomainMessengerImpl =
await Factory__OVM_L1CrossDomainMessenger.deploy()
await Factory__L1CrossDomainMessenger.deploy()
// We use an upgradable proxy for the XDomainMessenger--deploy & set up the proxy.
L1CrossDomainMessenger = await deployProxyXDomainMessenger(
AddressManager,
......@@ -519,14 +519,14 @@ describe('L1CrossDomainMessenger', () => {
describe('blockMessage and allowMessage', () => {
it('should revert if called by an account other than the owner', async () => {
const OVM_L1CrossDomainMessenger2 =
const L1CrossDomainMessenger2 =
L1CrossDomainMessenger.connect(signer2)
await expect(
OVM_L1CrossDomainMessenger2.blockMessage(keccak256(calldata))
L1CrossDomainMessenger2.blockMessage(keccak256(calldata))
).to.be.revertedWith('Ownable: caller is not the owner')
await expect(
OVM_L1CrossDomainMessenger2.allowMessage(keccak256(calldata))
L1CrossDomainMessenger2.allowMessage(keccak256(calldata))
).to.be.revertedWith('Ownable: caller is not the owner')
})
......
......@@ -53,10 +53,10 @@ describe('L1StandardBridge', () => {
let L1ERC20: Contract
let L1StandardBridge: Contract
let Mock__OVM_L1CrossDomainMessenger: MockContract
let Mock__L1CrossDomainMessenger: MockContract
beforeEach(async () => {
// Get a new mock L1 messenger
Mock__OVM_L1CrossDomainMessenger = await smockit(
Mock__L1CrossDomainMessenger = await smockit(
await ethers.getContractFactory('L1CrossDomainMessenger'),
{ address: await l1MessengerImpersonator.getAddress() } // This allows us to use an ethers override {from: Mock__L2CrossDomainMessenger.address} to mock calls
)
......@@ -66,7 +66,7 @@ describe('L1StandardBridge', () => {
await ethers.getContractFactory('L1StandardBridge')
).deploy()
await L1StandardBridge.initialize(
Mock__OVM_L1CrossDomainMessenger.address,
Mock__L1CrossDomainMessenger.address,
DUMMY_L2_BRIDGE_ADDRESS
)
......@@ -108,7 +108,7 @@ describe('L1StandardBridge', () => {
)
const depositCallToMessenger =
Mock__OVM_L1CrossDomainMessenger.smocked.sendMessage.calls[0]
Mock__L1CrossDomainMessenger.smocked.sendMessage.calls[0]
const depositerBalance = await ethers.provider.getBalance(depositer)
......@@ -153,7 +153,7 @@ describe('L1StandardBridge', () => {
}
)
const depositCallToMessenger =
Mock__OVM_L1CrossDomainMessenger.smocked.sendMessage.calls[0]
Mock__L1CrossDomainMessenger.smocked.sendMessage.calls[0]
const depositerBalance = await ethers.provider.getBalance(aliceAddress)
expect(depositerBalance).to.equal(initialBalance.sub(depositAmount))
......@@ -214,11 +214,11 @@ describe('L1StandardBridge', () => {
await ethers.getContractFactory('L1StandardBridge')
).deploy()
await L1StandardBridge.initialize(
Mock__OVM_L1CrossDomainMessenger.address,
Mock__L1CrossDomainMessenger.address,
DUMMY_L2_BRIDGE_ADDRESS
)
Mock__OVM_L1CrossDomainMessenger.smocked.xDomainMessageSender.will.return.with(
Mock__L1CrossDomainMessenger.smocked.xDomainMessageSender.will.return.with(
'0x' + '22'.repeat(20)
)
......@@ -229,7 +229,7 @@ describe('L1StandardBridge', () => {
1,
NON_NULL_BYTES32,
{
from: Mock__OVM_L1CrossDomainMessenger.address,
from: Mock__L1CrossDomainMessenger.address,
}
)
).to.be.revertedWith(ERR_INVALID_X_DOMAIN_MSG_SENDER)
......@@ -240,7 +240,7 @@ describe('L1StandardBridge', () => {
expect(await ethers.provider.getBalance(NON_ZERO_ADDRESS)).to.be.equal(0)
const withdrawalAmount = 100
Mock__OVM_L1CrossDomainMessenger.smocked.xDomainMessageSender.will.return.with(
Mock__L1CrossDomainMessenger.smocked.xDomainMessageSender.will.return.with(
() => DUMMY_L2_BRIDGE_ADDRESS
)
......@@ -260,7 +260,7 @@ describe('L1StandardBridge', () => {
withdrawalAmount,
NON_NULL_BYTES32,
{
from: Mock__OVM_L1CrossDomainMessenger.address,
from: Mock__L1CrossDomainMessenger.address,
}
)
......@@ -291,7 +291,7 @@ describe('L1StandardBridge', () => {
)
const depositCallToMessenger =
Mock__OVM_L1CrossDomainMessenger.smocked.sendMessage.calls[0]
Mock__L1CrossDomainMessenger.smocked.sendMessage.calls[0]
const depositerBalance = await L1ERC20.balanceOf(aliceAddress)
......@@ -333,7 +333,7 @@ describe('L1StandardBridge', () => {
NON_NULL_BYTES32
)
const depositCallToMessenger =
Mock__OVM_L1CrossDomainMessenger.smocked.sendMessage.calls[0]
Mock__L1CrossDomainMessenger.smocked.sendMessage.calls[0]
const depositerBalance = await L1ERC20.balanceOf(aliceAddress)
expect(depositerBalance).to.equal(INITIAL_TOTAL_L1_SUPPLY - depositAmount)
......@@ -476,7 +476,7 @@ describe('L1StandardBridge', () => {
})
it('onlyFromCrossDomainAccount: should revert on calls from the right crossDomainMessenger, but wrong xDomainMessageSender (ie. not the L2DepositedERC20)', async () => {
Mock__OVM_L1CrossDomainMessenger.smocked.xDomainMessageSender.will.return.with(
Mock__L1CrossDomainMessenger.smocked.xDomainMessageSender.will.return.with(
'0x' + '22'.repeat(20)
)
......@@ -489,7 +489,7 @@ describe('L1StandardBridge', () => {
1,
NON_NULL_BYTES32,
{
from: Mock__OVM_L1CrossDomainMessenger.address,
from: Mock__L1CrossDomainMessenger.address,
}
)
).to.be.revertedWith(ERR_INVALID_X_DOMAIN_MSG_SENDER)
......@@ -518,7 +518,7 @@ describe('L1StandardBridge', () => {
// make sure no balance at start of test
expect(await L1ERC20.balanceOf(NON_ZERO_ADDRESS)).to.be.equal(0)
Mock__OVM_L1CrossDomainMessenger.smocked.xDomainMessageSender.will.return.with(
Mock__L1CrossDomainMessenger.smocked.xDomainMessageSender.will.return.with(
() => DUMMY_L2_BRIDGE_ADDRESS
)
......@@ -529,7 +529,7 @@ describe('L1StandardBridge', () => {
NON_ZERO_ADDRESS,
withdrawalAmount,
NON_NULL_BYTES32,
{ from: Mock__OVM_L1CrossDomainMessenger.address }
{ from: Mock__L1CrossDomainMessenger.address }
)
expect(await L1ERC20.balanceOf(NON_ZERO_ADDRESS)).to.be.equal(
......
......@@ -22,14 +22,14 @@ describe('L2CrossDomainMessenger', () => {
})
let Mock__TargetContract: MockContract
let Mock__OVM_L1CrossDomainMessenger: MockContract
let Mock__L1CrossDomainMessenger: MockContract
let Mock__OVM_L1MessageSender: MockContract
let Mock__OVM_L2ToL1MessagePasser: MockContract
before(async () => {
Mock__TargetContract = await smockit(
await ethers.getContractFactory('Helper_SimpleProxy')
)
Mock__OVM_L1CrossDomainMessenger = await smockit(
Mock__L1CrossDomainMessenger = await smockit(
await ethers.getContractFactory('L1CrossDomainMessenger')
)
Mock__OVM_L1MessageSender = await smockit(
......@@ -53,7 +53,7 @@ describe('L2CrossDomainMessenger', () => {
beforeEach(async () => {
L2CrossDomainMessenger =
await Factory__L2CrossDomainMessenger.deploy(
Mock__OVM_L1CrossDomainMessenger.address
Mock__L1CrossDomainMessenger.address
)
})
......@@ -97,7 +97,7 @@ describe('L2CrossDomainMessenger', () => {
beforeEach(async () => {
Mock__OVM_L1MessageSender.smocked.getL1MessageSender.will.return.with(
Mock__OVM_L1CrossDomainMessenger.address
Mock__L1CrossDomainMessenger.address
)
})
......@@ -131,7 +131,7 @@ describe('L2CrossDomainMessenger', () => {
it('should revert if trying to send the same message twice', async () => {
Mock__OVM_L1MessageSender.smocked.getL1MessageSender.will.return.with(
Mock__OVM_L1CrossDomainMessenger.address
Mock__L1CrossDomainMessenger.address
)
await L2CrossDomainMessenger.relayMessage(target, sender, message, 0)
......@@ -143,7 +143,7 @@ describe('L2CrossDomainMessenger', () => {
it('should not make a call if the target is the L2 MessagePasser', async () => {
Mock__OVM_L1MessageSender.smocked.getL1MessageSender.will.return.with(
Mock__OVM_L1CrossDomainMessenger.address
Mock__L1CrossDomainMessenger.address
)
target = predeploys.OVM_L2ToL1MessagePasser
message = Mock__OVM_L2ToL1MessagePasser.interface.encodeFunctionData(
......@@ -184,7 +184,7 @@ describe('L2CrossDomainMessenger', () => {
it('should revert if trying to reenter `relayMessage`', async () => {
Mock__OVM_L1MessageSender.smocked.getL1MessageSender.will.return.with(
Mock__OVM_L1CrossDomainMessenger.address
Mock__L1CrossDomainMessenger.address
)
const reentrantMessage =
......
......@@ -111,7 +111,7 @@ export class MessageRelayerService extends BaseService<MessageRelayerOptions> {
this.logger.info('Connecting to L1CrossDomainMessenger...')
this.state.L1CrossDomainMessenger = await loadContractFromManager({
name: 'L1CrossDomainMessenger',
proxy: 'Proxy__OVM_L1CrossDomainMessenger',
proxy: 'Proxy__L1CrossDomainMessenger',
Lib_AddressManager: this.state.Lib_AddressManager,
provider: this.options.l1RpcProvider,
})
......
......@@ -40,7 +40,7 @@ describe('relay transaction generation functions', () => {
const factory2 = getContractFactory('ChainStorageContainer')
const factory3 = getContractFactory('StateCommitmentChain')
const mockBondManager = await smockit(getContractFactory('OVM_BondManager'))
const mockBondManager = await smockit(getContractFactory('BondManager'))
const mockCanonicalTransactionChain = await smockit(
getContractFactory('CanonicalTransactionChain')
)
......@@ -68,7 +68,7 @@ describe('relay transaction generation functions', () => {
StateCommitmentChain.address
)
await AddressManager.setAddress('OVM_BondManager', mockBondManager.address)
await AddressManager.setAddress('BondManager', mockBondManager.address)
await AddressManager.setAddress(
'CanonicalTransactionChain',
......
......@@ -31,7 +31,7 @@ This bond will be slashed in the event of a successful fraud proof on a state ro
### Roles
- Process transactions from the CTC, and propose new state roots by posting them to the SCC.
- MUST be collateralized by depositing a bond to the `OVM_BondManager` .
- MUST be collateralized by depositing a bond to the `BondManager` .
**Future note:** The Proposer is currently identical to the Sequencer. This is expected to change.
......
......@@ -261,7 +261,7 @@ The logic of `appendStateBatch()` will compute the Merkle root of the batches an
##### `appendStateBatch()` requirements
- The batch may not be empty, at least one new state root must be added
- The `OVM_BondManager.isCollateralized(msg.sender)` must return `true`
- The `BondManager.isCollateralized(msg.sender)` must return `true`
- The resulting number of elements in the SCC (ie. all state commitments, not batches) must be less than or equal to the number of elements (ie. transactions) in the CTC.
#### Deleting batches from the SCC
......
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