Contract deployment and proxy of Pax contracts

Hi I am new to the community and I have been trying openzepplin for the blockchain.
I have been playing with https://github.com/paxosglobal/pax-contracts/ contract because it has smart contract implementation and proxy.
I have been successful in compiling and deploying locally (ganache-cli) using truffle.
I was happy to do that but it didn’t last long.
When I tried to deploy same in ropsten network, I ended up with error and fail to deploy contract when I change address file https://github.com/paxosglobal/pax-contracts/blob/master/migrations/2_deploy_contracts.js
at line number 10
from
await proxy.changeAdmin("0xf0b1eef88956b0a307fa87b5f5671aad6a5d330f");

to
await proxy.changeAdmin("0x79a28044af136e7aeccc0783e92fa07f2aef2e5c");

Once this is done, the next line
await proxiedPAX.initialize();

throw an exception

RuntimeError: VM Exception while processing transaction: revert Cannot call fallback function from the proxy admin at module.exports (/home/vmware/Development/Ethereum/pax-contracts/migrations/2_deploy_contracts.js:11:21) at process._tickCallback (internal/process/next_tick.js:68:7) Truffle v5.1.34 (core: 5.1.34) Node v10.16.3

If I don’t change then I can’t freeze any address because the admin is 0xf0b1eef88956b0a307fa87b5f5671aad6a5d330f not 0x79a28044af136e7aeccc0783e92fa07f2aef2e5c

0xf0b1eef88956b0a307fa87b5f5671aad6a5d330f is the developer or paxos people’s address
0x79a28044af136e7aeccc0783e92fa07f2aef2e5c is my address in ropsten

If you can provide some information, then it will be great.
Thank you.

1 Like

Hi @commentors-net,

Welcome to the community :wave:

To learn about upgradeable contracts I suggest looking at the Upgrading Smart Contracts Learn guide. You can deploy the example to a local testnet then a public testnet.

I haven’t dug into the Pax contracts. I assume that you would need two addresses, one being the admin of the proxy, and the second to interact with the proxy contract to call functionality. See Transparent Proxies and Function Clashes for some background details.

Hi again,
This was really helpful.
Now the question goes, when I execute the script 2_deploy_contract.js in granache-cli, I get a contract number which is great.
But when I am making any change in contract, and try to deploy using “truffle migrate”, the code is contract file is compiled but during deployment I get “Network up to date.”.

In first version and in second version both I am using command “truffle migrate”. I have some say use the --reset but in real netwrok --reset isn’t the answer.
I know it isn’t truffle forum but somehow I see openzepplin and truffle makes a good team.

1 Like

Hi @commentors-net,

Apologies, I missed this reply. Were you able to resolve?

Hi @abcoathup,

I manage to figure out the solution. There is nothing wrong with the code but it was my understanding of it. It took me few days but I manage to understand how it works. Only thing I had to do is follow each line for deploy_contract.js and check the details of transaction to understand what was happening.
I notice that the person who is deploy can’t keep his own address as admin address, and I was trying to exact same thing which wasn’t allowed.
And thanks to you to when you provided the links which helped me to understand this.

1 Like

Hi @commentors-net,

Glad that you were able to resolve.