Using the Truffle console, I'm able to obtain the address of a deployed smart contract by issuing the following:
In this case,
MySmartContract is a smart contract written in Solidity and is compiled and migrated with Truffle to TestRPC.
Now, using the Web3-library, I'm able to obtain a 'reference' to the deployed smart contract by issuing the following statements:
...but obviously, I want to treat and access the smart contract like a singleton.
How do I obtain the address for a deployed (singleton) smart contract without having to specify its address?
While I have seen the term being used in blogs and tutorials, 'singleton' does indeed not cover it exactly; especially considering the fact that, if you upgrade a smart contract, its actually deployed to a different address. (Just trying to verify my understanding of things here; correct me if I'm wrong!)
But how exactly does Truffle know what contract I'm referring to with MySmartContract.deployed()?
Basically, I want to tell
web3: "Here is my contract ABI, find me its address on the blockchain!"